workspace.Workspace
-
Workspace is one tmuxp-style session description.
Guides#
Pages that discuss Workspace.
In other ports#
Describe a workspace as data
| Language | Equivalent |
|---|---|
| Python | tmuxp uses configuration dictionaries rather than a dedicated workspace value type |
| Ruby | Lib |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | config |
| Rust | config |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Workspace |
| OCaml | Libtmux |
| Perl | Lib Validates and copies a libtmux.workspace/v1 JSON-compatible configuration. |
No equivalent is recorded in Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.
Fields8#
| Name | Type | Description |
|---|---|---|
| SessionName | string | SessionName names the created session. It is required. |
| StartDirectory | string | StartDirectory is the default working directory for every window and pane that does not set its own. |
| Environment | map[string]string | Environment is written to the session after its initial pane exists and before later windows are created. |
| Options | map[string]string | Options are applied after session creation. tmux resolves window-option names against the session's current window. |
| GlobalOptions | map[string]string | GlobalOptions are applied after the initial window exists and before later windows are created. |
| CommandsBefore | []Command | CommandsBefore run in every pane before that pane's own commands. Window and pane entries add to this list rather than replacing it. |
| SuppressHistory | *Bool | SuppressHistory prefixes commands with a space unless a window or pane overrides it. Nil suppresses history, matching tmuxp. |
| Windows | []Window | Windows are created in order. A workspace needs at least one. |
Other members4#
Common operations2#
- InitialSessionRequest method InitialSessionRequest validates w and returns the request that creates its session and initial window. Use the resulting materialized session with
BuildIntoto continue the build over a caller-owned transport. - MissingDirectories method MissingDirectories returns absent start directories in document order. It is separate from
Workspace.Validatebecause a prior command may create them. tmux otherwise falls back to the user's home directory without an error. Names beginning with ~ are resolved as tmux resolves them.
Other members2#
- UnmarshalYAML method UnmarshalYAML decodes the workspace, then its shell_command_before, which accepts one command or a list.
- Validate method Validate reports all problems joined under
ErrInvalidWorkspace.