Core Library0.xGuides

Choose documentation 2

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.

Read and change options

Pass a native server, session, window or pane to select its option table. Use -Scope to override the table and -Global to request global defaults. tmux still selects pane-local options when pane scope is requested; -Global does not make them global. A server handle with -Scope Session -Global addresses global session defaults. Choose the endpoint explicitly with New-TmuxServer.

Read the effective key mode from a previously selected $session:

Terminal window
$session | Get-TmuxOption -Name 'status-keys' -IncludeInherited

Each result is a native TmuxOption. Its Name, Index, Inherited and Value describe what tmux reported. Omit -Name to list a table. A normal read lists local values; -IncludeInherited adds inherited values. -Quiet makes a missing option produce no rows. Where-Object filters returned rows locally.

Store a user option and return the value tmux actually stored:

Terminal window
$session | Set-TmuxOption -Name '@project' -Value 'api' -PassThru

-PassThru emits a native TmuxOptionValue; its Raw, Boolean, Integer and State fields preserve tmux’s interpretation. Without it, setting emits no success output. -Append and -ExpandFormat return the stored result, not just the supplied argument. -PreventOverwrite asks tmux to refuse replacement and can produce an error.

Remove a previously stored user option:

Terminal window
$session | Remove-TmuxOption -Name '@scratch'

Removing a built-in override restores inheritance. An empty string is a stored value, so setting '' does not remove an option. Indexed names such as command-alias[40] read, set or remove that specific array entry; listing the base name preserves sparse indices. tmux expands formats in option names, so # is not guaranteed literal.

Set and Remove support -WhatIf and -Confirm; previews contact no server. Errors retain the original core exception and owner. -ErrorAction Continue permits later owners; Stop terminates the pipeline. Cancellation cannot undo a dispatched mutation. Readback does not make a mutation atomic with other clients.

Esc

Type to search.

Reference previewOpen reference