# LibTmux\Send-TmuxText

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

```
Send-TmuxText
    [-Pane] <LibTmux.Pane>
    [-Text] <System.String>
    [-Enter]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
```

Send literal text and optional [`Enter`](/en/csharp/latest/reference/libtmux-sendkeysrequest-enter/) to a native pane.

Text is literal: key names, leading dashes, semicolons and tmux format markers
remain text. [`Enter`](/en/csharp/latest/reference/libtmux-sendkeysrequest-enter/) is sent only when requested. Newlines already present in
Text are delivered regardless of the [`Enter`](/en/csharp/latest/reference/libtmux-sendkeysrequest-enter/) switch; they can execute commands
in the receiving shell or application. NUL characters are rejected before I/O.

An empty string is accepted, including with [`Enter`](/en/csharp/latest/reference/libtmux-sendkeysrequest-enter/) to send just that key.

The endpoint and daemon generation come from the supplied native pane.
[`WhatIf`](/en/powershell/latest/reference/libtmux-send-tmuxtext/#LibTmux%5CSend-TmuxText.parameter.WhatIf) performs no acquisition or sending. Confirmation names the endpoint
and pane without displaying the supplied text or keys. Successful sending
confirms tmux accepted input; use an explicit application readiness signal
before checking that a command has finished.

### Notes

Failures use [`Tmux.TextSendFailed`](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux/Send-TmuxText.md#notes) and retain the original core exception,
its dispatch information and the failed pane. [`ErrorAction`](/en/powershell/latest/reference/libtmux-send-tmuxtext/#LibTmux%5CSend-TmuxText.parameter.ErrorAction) Continue permits
later owners to be processed; [`ErrorAction`](/en/powershell/latest/reference/libtmux-send-tmuxtext/#LibTmux%5CSend-TmuxText.parameter.ErrorAction) Stop stops on the first failure.
NUL content uses [`Tmux.InvalidInput`](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux/Send-TmuxText.md#notes) before dispatch;
PowerShell handles parameter binding errors. Cancellation stops pending work
but cannot undo delivered input. Nothing is retried.
If text was sent but the following [`Enter`](/en/csharp/latest/reference/libtmux-sendkeysrequest-enter/) fails, the core reports unknown
partial dispatch. Retrying the whole operation can duplicate effects.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/reference/glossary/#cmdlet)
- **Confirmation:** Supports `-WhatIf` and `-Confirm`; confirm impact: Medium.
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Pane`: A native pane selected from an explicit endpoint.
- **Outputs:** `System.Void`

Related APIs:

- [Choose endpoints and owners](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/read.md)
- [Capture pane output](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/capture.md)

## Examples

Example 1

Use a previously selected native $pane on an endpoint you own.

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

```powershell
$pane | LibTmux\Send-TmuxText -Text 'Enter' -Confirm:$false
```

## Parameters

- `Pane` (`LibTmux.Pane`): The native pane selected from the endpoint you intend to change.
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Text` (`System.String`): Literal text to send. Empty text is valid; NUL is unsupported. Newlines and
control characters can affect the receiving application.
  Required. Position 1. Does not accept pipeline input. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Enter` (`System.Management.Automation.SwitchParameter`): Send one Enter key after the literal text. Omitted by default.
  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`.
- `WhatIf` (`System.Management.Automation.SwitchParameter`): Describe the intended input operation without acquiring or sending anything.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input. Aliases: `wi`.
- `Confirm` (`System.Management.Automation.SwitchParameter`): Prompts for confirmation before sending input.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input. Aliases: `cf`.

## Returns

`None`: No success objects are emitted. An empty owner pipeline performs no work.
