Pane.SendKeysAndWaitAsync
Sends keys to the pane and waits for what it prints in response.
Source and package
- Module
- LibTmux
- Declared in
- Pane
- Package
- LibTmux
- Source
- src/LibTmux/Pane.Waiting.cs
- SendKeysAndWaitAsync ( keys : Send
Keys , wait : PaneRequest Wait , cancellationToken : CancellationRequest Token ) Task<PaneWait >Result -
Description#
The wait reads the screen before the keys go, so output that follows at once is not missed, and judges only what the pane prints afterwards: text already on screen never ends it. A shell echoes typed text back, so literal text (
Literal, asSendTextAsyncsends) is removed from what the pane shows before matching, including the part of a line the shell has echoed so far. Waiting fordoneafter typingecho donetherefore waits for the command's output, not for the line that was typed.The removal is by text: output identical to a typed line, as a whole word, is removed too. Key names, and text sent with
ExpandFormats,Repeator a copy-mode command, are not removed.A typed line the pane wrapped onto a second row is still recognised. Like
WaitForTextAsync, the wait sleeps on the pane's output through a control-mode client. Typed literal text may be at most 65536 UTF-8 bytes; ordinarySendKeysAsynchas no echo-projection limit.- Parameters
-
-
keys ( Send
Keys ) – What to type.Request -
wait ( Pane
Wait ) – The patterns that end the wait, and how long to wait.Request -
cancellationToken ( Cancellation
Token ) – Stops the wait; keys already sent stay sent.
-
- Returns
-
How the wait ended.
- Raises
-
-
Argument
Exception – The request has no patterns or typed literal text exceeds 65536 UTF-8 bytes. -
Argument
Out – The timeout is negative or longer than 49 days.Of Range Exception -
IOException – Echo projection exceeds its bounded work.
-
Regex
Match – Echo matching exceeds its finite regex time.Timeout Exception -
Tmux
Pane – The pane's program had already exited, or the pane changed during every read until the timeout, so nothing was sent.Exception -
Tmux
Object – tmux no longer has the pane.Not Found Exception -
Lib
Tmux – The text was sent but a requested Enter failed. The pane may already have acted on the text; do not retry the whole call.Exception
-