Read and change options
Needs libtmux for PowerShell 0.x Install
Pass a server, session, window or pane to select its option table. Choose the endpoint with New-TmuxServer.
-Scopeoverrides the table and-Globalrequests global defaults.- Pane options stay pane-local when pane scope is requested;
-Globaldoes not make them global. - A server handle with
-Scope Session -Globaladdresses the global session defaults.
Read the effective key mode from a previously selected $session:
$session | Get-TmuxOption -Name 'status-keys' -IncludeInheritedEach result is a TmuxOption whose Name,
Index, Inherited and Value are what
tmux reported.
- Without
-Name, the whole table is listed. - A read lists local values;
-IncludeInheritedadds inherited ones. -Quietmakes a missing option produce no rows.Where-Objectfilters the rows locally.
Store a user option and return the value tmux actually stored:
$session | Set-TmuxOption -Name '@project' -Value 'api' -PassThru-PassThru emits a TmuxOptionValue whose Raw,
Boolean, Integer and State fields keep tmux’s
interpretation. Without it, setting emits nothing. -Append and -ExpandFormat
return the stored result, not the supplied argument. -PreventOverwrite asks
tmux to refuse a replacement and can produce an error.
Remove a previously stored user option:
$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. - An indexed name such as
command-alias[40]reads, sets or removes that array entry. Listing the base name keeps sparse indices. - tmux expands formats in option names, so
#may not stay literal.
Set and Remove support -WhatIf and -Confirm, and previews contact no server.
Errors keep the original core exception and owner. -ErrorAction Continue lets
later owners run, and Stop ends the pipeline. Cancellation
cannot undo a mutation already sent, and readback is not atomic with other
clients.