LibTmux.Wait-TmuxChannel
LibTmux\Wait-TmuxChannel Wait for a tmux channel signal with a timeout and owned withdrawal.
Source and package
- Declared in
- LibTmux
- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/WaitTmuxChannelCommand.cs
- Wait-TmuxChannel [-Server] <Lib
Tmux > [-Channel] <System.Server .String > [-Timeout <System.Double >] [<CommonParameters >] -
Description#
Waiton the supplied native server and emit True after observing a channel signal. A pending signal from before the call also completes the wait. An empty owner pipeline performs no work and emits no output.Use one open waiter per channel and give each operation a unique channel. tmux has no individual waiter deregistration: withdrawing signals the channel and wakes every waiter registered there. This command owns and disposes its wait, including on timeout or pipeline cancellation, so an abandoned client cannot consume a later signal. The borrowed server remains running.
The timeout bounds the wait attempt. Withdrawal is awaited before returning; cleanup time is additional. A signal racing withdrawal can leave the channel pending for a later caller. Do not infer that no signal arrived from a timeout, and do not reuse a channel to identify a different operation.
Notes
Tmux.ChannelWaitFailedretains the native server as its target. Timeout uses TimeoutException with the OperationTimeout category and emits no success object.ErrorActionContinue permits later owners to run;ErrorActionStop terminates on failure. Ctrl+C cancels the attempt and withdraws the waiter before the pipeline stops. Cancellation cannot undo work in the producer. Invalid channels and timeouts fail before contacting tmux.Command details#
- Command type
cmdlet- Positional binding
- Enabled.
- Pipeline inputs
-
LibTmux.Server: The native server to wait on. - Outputs
-
System.Boolean
Examples#
Example 1 Use a previously selected native
$serverand reserve build-finished for one waiter. Have the producer run tmux wait-for-Sbuild-finished on that server after its work completes. The producer may signal before this command starts. View sourceTerminal window $server | LibTmux\Wait-TmuxChannel -Channel 'build-finished' -Timeout 10- Parameters
-
-
The native server endpoint that owns the channel.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
The nonempty, non-whitespace channel reserved for this operation. NUL is rejected.
- Required
- Yes
- Position
- 1
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
The wait budget in seconds. Fractions are accepted. The default is 10; the valid range is 0.0000001 through 86400. NaN and infinity are rejected.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
10
Common parameters 12
PowerShell supplies these parameters. See common parameter behavior for their effects.
-
-Verbose(System.Management ) #.Automation .Switch Parameter Display verbose messages produced by this command.
Aliases:vbMicrosoft Learn reference -
-Debug(System.Management ) #.Automation .Switch Parameter Display debug messages produced by this command.
Aliases:dbMicrosoft Learn reference -
-ErrorAction(System.Management ) #.Automation .Action Preference Choose how this command responds to non-terminating errors.
Aliases:eaMicrosoft Learn reference -
-WarningAction(System.Management ) #.Automation .Action Preference Choose how this command responds to warning messages.
Aliases:waMicrosoft Learn reference -
-InformationAction(System.Management ) #.Automation .Action Preference Choose how this command handles information messages.
Aliases:infaMicrosoft Learn reference -
-ProgressAction(System.Management ) #.Automation .Action Preference Choose how this command handles progress updates.
Aliases:progaMicrosoft Learn reference -
-ErrorVariable(System.String ) #Store the command's error records in the named variable.
Aliases:evMicrosoft Learn reference -
-WarningVariable(System.String ) #Store the command's warning records in the named variable.
Aliases:wvMicrosoft Learn reference -
-InformationVariable(System.String ) #Store the command's information records in the named variable.
Aliases:ivMicrosoft Learn reference -
-OutVariable(System.String ) #Save output in the named variable while passing it down the pipeline.
Aliases:ovMicrosoft Learn reference -
Buffer output before passing it to the next pipeline command.
Aliases:obMicrosoft Learn reference -
-PipelineVariable(System.String ) #Make the most recent output object available through a named variable within the pipeline.
Aliases:pvMicrosoft Learn reference
-
- Returns
-
System.Boolean: True after observing a signal. Timeout emits an error, not False.
Discussed in Send input to a pane