On this page
Server.sendKeys(_:to:literally:)
- Declared in
- Server
- Package
- libtmux-swift
- Source
- Sources/LibTmux/PaneInteraction.swift
- Other languages
- PythonTypeScriptRustGo Java .NETC++
-
-
Sends keys to a pane.
- Parameters:
- keys: what to send, one argument per key or literal string.
- pane: the pane to send them to.
- literally: sends the text as characters rather than letting tmux read names like
EnterorC-cout of it. Use it for anything that came from a user.
- Raises
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
- .NET
LibTmux.Pane.SendKeysAsync - C++
libtmux::Pane::send_text
- Parameters:
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