On this page
pane.Pane.sendKeys
- Module
- pane
- Declared in
- Pane
- Package
- @libtmux/libtmux
- Source
- packages/libtmux/src/pane.ts
- Other languages
- PythonRustGo Java .NETC++Swift
-
Send keys to this pane, following them with Enter unless told not to.
Examples
await pane.sendKeys("echo hello"); await pane.sendKeys("C-c", { literal: false });Discussed in Pane interaction
In other languages Send keystrokes to a pane
- Python
libtmux.Pane.send_keys - Rust
pane.Pane.send_keys - Go
tmux.Pane.SendKeys - 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
await pane.sendKeys("echo hello");
await pane.sendKeys("C-c", { literal: false }); >>> 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) 0 declared, 0 inherited