Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Edit this page on GitHub

Send literal text to type characters into a pane, or send tmux key names such as C-c, Enter, and Up to press those keys. Check the method’s literal-text and Enter defaults: typing the word Enter and pressing Enter are different operations.

Literal text, key names, and whether Enter followsLink to section

These examples show each port’s text, named-key, and Enter behavior. Attach and send keys provides the full source examples and validation details.

Check each method’s input contract before sending text that could be a key name. Some ports separate text and key-name methods; others use a literal-text flag. Concepts introduces the shared tmux model.

The race you can’t see from the call siteLink to section

Completing send-keys means tmux accepted the input. The shell may still be starting, and the command may still be running. The port examples provide different ways to wait:

  • Rust uses a retry_until loop in the README’s query example to wait for the shell.
  • Go provides tmuxtest.WaitForShellReady for tests that need a ready shell.
  • .NET demonstrates waiting for command output in the README’s “Running something, and reading it back” section.

Wait for shell readiness before sending input when startup matters. Then wait for the command’s expected output or a completion signal before reading its result. The next guide covers those waiting APIs.

Where to go nextLink to section

  • Capturing output: reading back what you just sent, and waiting for it correctly instead of guessing a delay.
  • Attach and send keys: the full sourced round trip this guide picks apart piece by piece.
Esc

Type to search.