On this page
LibTmux.Pane.SendKeysAsync
- Module
- LibTmux
- Declared in
- Pane
- Package
- LibTmux
- Source
- src/LibTmux/Pane.Input.cs
- Other languages
- PythonTypeScriptRustGo Java C++Swift
- SendKeysAsync ( request : SendKeysRequest , cancellationToken : CancellationToken ) Task
-
Sends keys to the pane.
- Parameters
-
-
request ( SendKeysRequest ) – What to send.
-
cancellationToken ( CancellationToken ) – Cancels the tmux commands.
-
- Raises
-
-
ArgumentException – The request sends nothing.
-
LibTmuxException – Text was sent, but a requested Enter failed. Its dispatch state is unknown, so the whole request must not be retried.
-
Discussed in Pane interaction
In other languages Send keystrokes to a pane
- Python
libtmux.Pane.send_keys - TypeScript
pane.Pane.sendKeys - Rust
pane.Pane.send_keys - Go
tmux.Pane.SendKeys - Java no direct equivalent; `Pane.paste` writes a buffer instead
- C++
libtmux::Pane::send_text - Swift
Server.sendKeys(_:to:literally:)
Examples
>>> pane = window.split(shell='sh')
>>> pane.capture_pane()
['$'] >>> pane.send_keys('echo "Hello world"', enter=True) >>> pane.capture_pane()
['$ echo "Hello world"', 'Hello world', '$'] >>> print('\n'.join(pane.capture_pane())) # doctest: +NORMALIZE_WHITESPACE
$ echo "Hello world"
Hello world
$ Flag-only invocation — reset terminal state without sending any keys:
>>> pane.send_keys(reset=True) await pane.sendKeys("echo hello");
await pane.sendKeys("C-c", { literal: false }); 0 declared, 0 inherited