# LibTmux\Get-TmuxOption

- **Package:** LibTmux
- **Language:** PowerShell
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/src/LibTmux.PowerShell/GetTmuxOptionCommand.cs#L7
- **Page:** https://libtmux.org/en/powershell/latest/reference/libtmux-get-tmuxoption/

```
Pane:
Get-TmuxOption
    [-Pane] <LibTmux.Pane>
    [-Name <System.String>]
    [-Scope <System.Nullable[LibTmux.OptionScope]>]
    [-Global]
    [-IncludeInherited]
    [-IncludeHooks]
    [-Quiet]
    [<CommonParameters>]

Server (default):
Get-TmuxOption
    [-Server] <LibTmux.Server>
    [-Name <System.String>]
    [-Scope <System.Nullable[LibTmux.OptionScope]>]
    [-Global]
    [-IncludeInherited]
    [-IncludeHooks]
    [-Quiet]
    [<CommonParameters>]

Session:
Get-TmuxOption
    [-Session] <LibTmux.Session>
    [-Name <System.String>]
    [-Scope <System.Nullable[LibTmux.OptionScope]>]
    [-Global]
    [-IncludeInherited]
    [-IncludeHooks]
    [-Quiet]
    [<CommonParameters>]

Window:
Get-TmuxOption
    [-Window] <LibTmux.Window>
    [-Name <System.String>]
    [-Scope <System.Nullable[LibTmux.OptionScope]>]
    [-Global]
    [-IncludeInherited]
    [-IncludeHooks]
    [-Quiet]
    [<CommonParameters>]
```

Read a native tmux option table or named option.

The native owner selects its option table. Scope overrides that choice, and Global
selects global defaults. A named read emits each native [`TmuxOption`](/en/csharp/latest/reference/libtmux-tmuxoption/) row, preserving
sparse array indices, inherited markers and [`TmuxOptionValue`](/en/csharp/latest/reference/libtmux-tmuxoptionvalue/) fields. Omit Name to
list the table. IncludeInherited requests inherited values explicitly.

Global values and local overrides remain separate. Names follow tmux syntax,
including array indices and tmux format expansion. Use [`Where-Object`](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/where-object?view=powershell-7.4) on returned
rows for local PowerShell filtering.

### Notes

Reads contact tmux explicitly. Empty owner pipelines perform no I/O. Errors retain
the original core exception and native owner as their target. [`ErrorAction`](/en/powershell/latest/reference/libtmux-get-tmuxoption/#LibTmux%5CGet-TmuxOption.parameter.ErrorAction) Continue
permits later owners; Stop terminates the pipeline. Cancellation stops the
operation but cannot undo a dispatched mutation. Set readback is an observation,
not a transaction with other clients.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/reference/glossary/#cmdlet)
- **Default parameter set:** Server
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Server`: A native server owner.; `LibTmux.Session`: A native session owner.; `LibTmux.Window`: A native window owner.; `LibTmux.Pane`: A native pane owner.
- **Outputs:** `LibTmux.TmuxOption`

Related APIs:

- [Options](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/options.md)

## Examples

Example 1

Read the effective key mode from a previously selected native $session.

[Source example](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux/Get-TmuxOption.md).

```powershell
$session | LibTmux\Get-TmuxOption -Name 'status-keys' -IncludeInherited
```

## Parameters

- `Pane` (`LibTmux.Pane`): The native pane whose table is used. (for `Pane`)
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Name` (`System.String`): The tmux option name, optionally indexed. tmux expands formats in option names; this is not a literal wildcard selector. Whitespace-only names and NUL are rejected.
  Optional. Named parameter. Does not accept pipeline input. [`ValidateNotNullOrEmpty()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnulloremptyattribute?view=powershellsdk-7.4.0). [`ValidatePattern("\\A[^\\x00]*[^\\s\\x00][^\\x00]*\\z")`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatepatternattribute?view=powershellsdk-7.4.0).
- `Scope` (`System.Nullable[LibTmux.OptionScope]`): Override the owner scope with Server, Session, Window or Pane. Omission uses the native owner scope.
  Optional. Named parameter. Does not accept pipeline input. [`ValidateSet(["Server","Session","Window","Pane"])`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatesetattribute?view=powershellsdk-7.4.0).
- `Global` (`System.Management.Automation.SwitchParameter`): Use the global table for the selected scope. For global session defaults from a Server, specify Scope Session and Global.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `IncludeInherited` (`System.Management.Automation.SwitchParameter`): Include values inherited from a parent scope.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `IncludeHooks` (`System.Management.Automation.SwitchParameter`): Include hooks alongside options.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `Quiet` (`System.Management.Automation.SwitchParameter`): Pass tmux its quiet flag. Missing reads emit no objects; suppressed writes may return an absent value with PassThru.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `Verbose` (`System.Management.Automation.SwitchParameter`): Display verbose messages produced by this command.
  Optional. Named parameter. Switch parameter. Common parameter. Does not accept pipeline input. Aliases: `vb`.
- `Debug` (`System.Management.Automation.SwitchParameter`): Display debug messages produced by this command.
  Optional. Named parameter. Switch parameter. Common parameter. Does not accept pipeline input. Aliases: `db`.
- `ErrorAction` (`System.Management.Automation.ActionPreference`): Choose how this command responds to non-terminating errors.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ea`.
- `WarningAction` (`System.Management.Automation.ActionPreference`): Choose how this command responds to warning messages.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `wa`.
- `InformationAction` (`System.Management.Automation.ActionPreference`): Choose how this command handles information messages.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `infa`.
- `ProgressAction` (`System.Management.Automation.ActionPreference`): Choose how this command handles progress updates.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `proga`.
- `ErrorVariable` (`System.String`): Store the command's error records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ev`.
- `WarningVariable` (`System.String`): Store the command's warning records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `wv`.
- `InformationVariable` (`System.String`): Store the command's information records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `iv`.
- `OutVariable` (`System.String`): Save output in the named variable while passing it down the pipeline.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ov`.
- `OutBuffer` (`System.Int32`): Buffer output before passing it to the next pipeline command.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ob`.
- `PipelineVariable` (`System.String`): Make the most recent output object available through a named variable within the pipeline.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `pv`.
- `Server` (`LibTmux.Server`): The native server whose table is used. (for `Server`)
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Session` (`LibTmux.Session`): The native session whose table is used. (for `Session`)
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Window` (`LibTmux.Window`): The native window whose table is used. (for `Window`)
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).

## Returns

`LibTmux.TmuxOption`: One object per option or array entry, in tmux order.
