# LibTmux\Get-TmuxPaneContent

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

```
History:
Get-TmuxPaneContent
    [-Pane] <LibTmux.Pane>
    [-EndLine <System.Nullable[System.Int32]>]
    -History
    [-Raw]
    [-EscapeSequences]
    [-EscapeNonPrintable]
    [-JoinWrappedLines]
    [-PreserveTrailingSpaces]
    [-TrimTrailingSpaces]
    [-AlternateScreen]
    [-Quiet]
    [-ModeScreen]
    [-Pending]
    [-Hyperlinks]
    [-LineNumbers]
    [-LineFlags]
    [<CommonParameters>]

Range (default):
Get-TmuxPaneContent
    [-Pane] <LibTmux.Pane>
    [-StartLine <System.Nullable[System.Int32]>]
    [-EndLine <System.Nullable[System.Int32]>]
    [-Raw]
    [-EscapeSequences]
    [-EscapeNonPrintable]
    [-JoinWrappedLines]
    [-PreserveTrailingSpaces]
    [-TrimTrailingSpaces]
    [-AlternateScreen]
    [-Quiet]
    [-ModeScreen]
    [-Pending]
    [-Hyperlinks]
    [-LineNumbers]
    [-LineFlags]
    [<CommonParameters>]
```

Capture rendered text from a pane.

Read a native pane through the core capture request. By default each captured line is a separate string. Raw returns one string joined with LF, without inventing a trailing newline. History starts at the beginning of retained history; StartLine and EndLine select explicit bounds.

### Notes

Capture is rendered terminal text, not a byte-exact output stream or proof that a shell command completed. History and StartLine are exclusive. [`PreserveTrailingSpaces`](/en/csharp/latest/reference/libtmux-capturepanerequest-preservetrailingspaces/) and [`TrimTrailingSpaces`](/en/csharp/latest/reference/libtmux-capturepanerequest-trimtrailingspaces/) cannot both be selected. Core capability checks govern flags on older tmux versions.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/reference/glossary/#cmdlet)
- **Default parameter set:** Range
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Pane`: Native pipeline type for this command.
- **Outputs:** `System.String`

Related APIs:

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

## Examples

Example 1

Capture the first pane on the existing server identified by $SocketPath.

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

```powershell
LibTmux\New-TmuxServer -SocketPath $SocketPath |
    LibTmux\Get-TmuxPane |
    Select-Object -First 1 |
    LibTmux\Get-TmuxPaneContent -Raw
```

## Parameters

- `Pane` (`LibTmux.Pane`): The pane to capture.
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `EndLine` (`System.Nullable[System.Int32]`): The last line, relative to the visible pane.
  Optional. Named parameter. Does not accept pipeline input.
- `History` (`System.Management.Automation.SwitchParameter`): Whether capture starts at the oldest retained history. (for `History`)
  Required. Named parameter. Switch parameter. Does not accept pipeline input.
- `Raw` (`System.Management.Automation.SwitchParameter`): Whether lines are joined with lf into one rendered string.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `EscapeSequences` (`System.Management.Automation.SwitchParameter`): Whether terminal escape sequences are retained.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `EscapeNonPrintable` (`System.Management.Automation.SwitchParameter`): Whether nonprintable bytes use octal escapes.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `JoinWrappedLines` (`System.Management.Automation.SwitchParameter`): Whether wrapped screen lines are joined.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `PreserveTrailingSpaces` (`System.Management.Automation.SwitchParameter`): Whether trailing spaces are retained.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `TrimTrailingSpaces` (`System.Management.Automation.SwitchParameter`): Whether trailing spaces are removed.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `AlternateScreen` (`System.Management.Automation.SwitchParameter`): Whether the alternate screen is captured.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `Quiet` (`System.Management.Automation.SwitchParameter`): Whether a missing alternate screen returns empty content.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `ModeScreen` (`System.Management.Automation.SwitchParameter`): Whether the pane's mode screen is captured.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `Pending` (`System.Management.Automation.SwitchParameter`): Whether incomplete pending output is captured.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `Hyperlinks` (`System.Management.Automation.SwitchParameter`): Whether supported captures include hyperlinks.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `LineNumbers` (`System.Management.Automation.SwitchParameter`): Whether supported captures include line numbers.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `LineFlags` (`System.Management.Automation.SwitchParameter`): Whether supported captures include line flags.
  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`.
- `StartLine` (`System.Nullable[System.Int32]`): The first line; negative values address scrollback. (for `Range`)
  Optional. Named parameter. Does not accept pipeline input.

## Returns

`System.String`: Native pipeline type for this command.
