Workspace ManagerconceptAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

workspace.Workspace

struct workspace.Workspace

Workspace is one tmuxp-style session description.

Guides#

Pages that discuss Workspace.

In other ports#

Describe a workspace as data

Equivalents of Describe a workspace as data in other languages
Language Equivalent
Python tmuxp uses configuration dictionaries rather than a dedicated workspace value type
Ruby LibTmux::Workspace
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript config.Workspace
Rust config.Workspace
Java io.github.libtmux.workspace.Workspace
C# LibTmux.Workspace.WorkspaceFile
C++ libtmux::workspace::Workspace
Swift Workspace
OCaml Libtmux_workspace.Config.t
Perl LibTmux::Workspace::new 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#

Workspace fields
NameTypeDescription
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 BuildInto to continue the build over a caller-owned transport.
  • MissingDirectories method MissingDirectories returns absent start directories in document order. It is separate from Workspace.Validate because 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.
Esc

Type to search.

Reference previewOpen reference