On this page
tmux.Pane.SendKeys
- Module
- tmux
- Declared in
- Pane
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/pane_input.go
- Other languages
- PythonTypeScriptRust Java .NETC++Swift
- SendKeys ( ctx : context.Context , request : SendKeysRequest ) error
-
SendKeys invokes tmux send-keys with the receiver's exact linked session-window-pane target. This is tmux key input, not shell execution: Literal only changes tmux key parsing, and any delivered text may still be interpreted by the pane's application. KeyName routes through a client's key table instead of delivering to the pane.
KeyName and TargetClient require tmux 3.4 and follow
UnsupportedPolicy.Completed exit status and stderr are ignored. Transport and context errors are delivery-ambiguous, including between Command and the separate Enter.
In other languages Send keystrokes to a pane
- Python
libtmux.Pane.send_keys - TypeScript
pane.Pane.sendKeys - Rust
pane.Pane.send_keys - Java no direct equivalent; `Pane.paste` writes a buffer instead
- .NET
LibTmux.Pane.SendKeysAsync - C++
libtmux::Pane::send_text - Swift
Server.sendKeys(_:to:literally:)
- Python
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