# LibTmux\Get-TmuxClientAttachment

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

```
Get-TmuxClientAttachment
    [-Client] <LibTmux.Client>
    [<CommonParameters>]
```

Resolve the session, window and pane a client currently views.

Resolve current attachment data through the native core. Return a
[`ClientAttachment`](/en/csharp/latest/reference/libtmux-clientattachment/) containing native [`Session`](/en/csharp/latest/reference/libtmux-session/), [`Window`](/en/csharp/latest/reference/libtmux-window/) and [`Pane`](/en/csharp/latest/reference/libtmux-pane/) handles. A detached
client or missing session produces no output. [`Window`](/en/csharp/latest/reference/libtmux-window/) or [`Pane`](/en/csharp/latest/reference/libtmux-pane/) can be null when
unavailable. This explicit live read leaves the original [`Client`](/en/csharp/latest/reference/libtmux-client/) unchanged.

### Notes

The observation uses several tmux reads and is not a transaction. [`Server`](/en/csharp/latest/reference/libtmux-server/) or
transport failures write an error rather than becoming an empty result.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/reference/glossary/#cmdlet)
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Client`: Native pipeline owner.
- **Outputs:** `LibTmux.ClientAttachment`

Related APIs:

- [Task guide](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/clients.md)

## Examples

Example 1

Resolve the current attachment of a previously selected native $client.

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

```powershell
$client | LibTmux\Get-TmuxClientAttachment
```

## Parameters

- `Client` (`LibTmux.Client`): The native client whose current state is read.
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `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`.

## Returns

`LibTmux.ClientAttachment`: Native observed result.
