libtmux Reference MCP Search
On this page

pane.Pane.sendKeys

View as Markdown

Module
pane
Declared in
Pane
Package
@libtmux/libtmux
Source
packages/libtmux/src/pane.ts
Other languages
PythonRustGo Java .NETC++Swift
sendKeys ( keys : : string , options : : SendKeysOptions ) Promise<void>
method [source]
method [source]
sendKeys

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

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

Esc

Type to search.