LibTmux.Wait-TmuxPaneText
LibTmux\Wait-TmuxPaneText Wait for rendered text in a native tmux pane.
Source and package
- Declared in
- LibTmux
- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/WaitTmuxPaneTextCommand.cs
- Wait-TmuxPaneText [-Pane] <Lib
Tmux > [[-Pattern] <System.Pane .String []>] [-StopPattern <System.String []>] [-CaseSensitive ] [-SimpleMatch ] [-Timeout <System.Double >] [-AllowPolling ] [-TailFallback Lines <System.Int32 >] [-MaxOutput <SystemBytes .Int32 >] [-WhatIf ] [-Confirm] [<CommonParameters >] -
Description#
Watch the selected pane until one pattern matches rendered text. A match already visible when observation begins returns
PresentAtEntry. With no pattern, the command waits for any new rendered output and returnsAnyOutput. Stop patterns returnStopped; the deadline and a pane exit returnTimedOutandPaneExited. These are nativeLibTmux.PaneWaitResultoutcomes, not cmdlet errors. InspectOutcomebefore treating a wait as readiness.The observer attaches a temporary control client before its first capture. Control events wake a grid-aware reader; matching uses captured rendered rows, not individual output fragments. Results include a bounded final screen tail, elapsed and effective timeout, dropped-event count, polling fallback, and missed-line or lost-anchor indicators. The default view shows
Missedand omits the tail; inspectTailexplicitly if you need its text. A lost event or anchor means the observer may have missed transient output.Control observation is required by default.
-AllowPollingFallbackpermits bounded polling if control observation fails, and the result discloses whether it ran. The wait borrows the pane and server; it disposes only its own observer and client on completion or Ctrl+C.-WhatIfattaches no client and captures no text. Confirmation identifies the endpoint and pane without displaying patterns or pane content.This command recognizes text; it does not authenticate command completion or an exit status. Use Invoke-TmuxPaneCommand for a shell command you start or Wait-TmuxChannel for a cooperative application signal. Visible text can include input echoed by a shell or application.
Get-TmuxPaneContent -Historyreads retained rendered scrollback, while-Rawjoins rendered rows; neither is a byte-exact process stream.Notes
Tmux.PaneTextWaitFailedretains the native pane as its error target for transport and capture failures.Tmux.InvalidTimeoutandTmux.InvalidPaneTextRequestfail before attaching a client.-ErrorAction Continuecan advance to the next pane after an operation error;-ErrorAction Stopstops the pipeline.Command details#
- Command type
cmdlet- Confirmation
- Supports
-WhatIfand-Confirm; confirm impact: Medium. - Positional binding
- Enabled.
- Pipeline inputs
-
LibTmux.Pane: The pane selected from an explicit endpoint. - Outputs
-
LibTmux.PaneWaitResult
Examples#
Example 1 Given a native
$panerunning a program that reads one line, printsREADY, then stays alive, send a trigger that cannot match the ready pattern.Outputmay arrive before the wait begins; bothPresentAtEntryandMatchedmean the line was observed: View sourceTerminal window & {$pane | LibTmux\Send-TmuxText -Text go -Enter -Confirm:$false$pane |LibTmux\Wait-TmuxPaneText -Pattern '^READY$' -Timeout 5 -Confirm:$false}- Parameters
-
-
The native pane to observe. An arbitrary object with an Id property is not a pane owner.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-Pattern(System.String []) #Regular expressions to wait for. Omit or pass an empty array to wait for any new rendered output. Empty entries are rejected. The shared observer bounds regex matching work and time over rendered rows. It uses .NET's nonbacktracking regex mode; unsupported constructs such as lookarounds and backreferences are rejected before attaching a client.
- Required
- No
- Position
- 1
- Pipeline input
- No
-
-StopPattern(System.String []) #Regular expressions that end the wait with
Outcome = Stopped. Stop patterns take precedence over wanted patterns, including text visible at entry. Across both pattern lists, at most 32 entries, 999 UTF-8 bytes per entry and 16384 bytes in total are accepted.- Required
- No
- Position
- Named
- Pipeline input
- No
-
-CaseSensitive(System.Management ) #.Automation .Switch Parameter Match letter case.
Patternsare case-insensitive by default.- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
-SimpleMatch(System.Management ) #.Automation .Switch Parameter Treat each pattern and stop pattern as literal text instead of a regular expression.
-CaseSensitivestill controls case matching.- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
Waitbudget in seconds. Fractions are accepted. The default is 10; the valid range is 0.0000001 through 86400. A timed-out wait does not prove the program stopped or the desired text was never printed.- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
10
-
-AllowPollingFallback(System.Management ) #.Automation .Switch Parameter Allow bounded capture polling if the control client cannot observe the pane. The default is to report the control failure.
PollingFallbackdiscloses use.- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
Maximum rendered screen lines retained in the result tail. The default is 20; the valid range is 1 through 1000. Truncation is reported separately.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
20- Validation
ValidateRange(1, 1000)
-
-MaxOutputBytes(System.Int32 ) #Maximum UTF-8 bytes retained in the result tail. The default is 65536; the valid range is 1 through 1048576. This bounds returned text, not the producer.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
65536- Validation
ValidateRange(1, 1048576)
-
-WhatIf(System.Management ) #.Automation .Switch Parameter Describe the intended observer without attaching a client or capturing text.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
wi
-
-Confirm(System.Management ) #.Automation .Switch Parameter Prompt before attaching an observer. The prompt omits pattern and pane text.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
cf
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
-
LibTmux.PaneWaitResult:Oneresult per pane with outcome, matched pattern, bounded rendered tail and observation metadata. No result is emitted for-WhatIfor an empty pipeline.
Discussed in Wait for a service · Getting started · Dispatch, completion, and failure , Watching output and state