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.

MoreLess about this notice

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.

  • -Scope overrides the table and -Global requests global defaults.
  • Pane options stay pane-local when pane scope is requested; -Global does not make them global.
  • A server handle with -Scope Session -Global addresses the global session defaults.

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

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

Each 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; -IncludeInherited adds inherited ones.
  • -Quiet makes a missing option produce no rows.
  • Where-Object filters the 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 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:

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.
  • 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.

Esc
Search in

Type to search.

Reference previewOpen reference