Keys, formats and exit codes
Key names for send-keys, format variables for -F, and the exit codes of every command.
Key names
Enter, Escape, Tab, BTab, BSpace, Space, Up, Down, Left, Right, Home, End, PageUp (PgUp, PPage), PageDown (PgDn, NPage), IC (Insert), DC (Delete), F1~F12. Combine them with the prefixes C- (Ctrl), M- (Alt) and S- (Shift) (C-c, M-x, S-Up; ^c also works). Names are case-insensitive. The bytes sent were checked against tmux 3. Arguments that are not key names are sent as literal text.
When a program turns on application cursor mode (vim and others), the arrow keys switch to the ESC O A form, the same as tmux.
Format variables
Used by list-sessions -F, new-session -P -F and display-message.
| Variable | Meaning |
|---|---|
session_name, session_id, session_created, session_attached, session_windows | Session name, id starting with $ (pane_id starts with %), creation time (Unix seconds), number of attached terminals, number of windows (always 1) |
window_index, window_id, window_name, window_width, window_height, window_panes | Window information (there is always exactly one window) |
pane_id, pane_index, pane_pid, pane_width, pane_height | Pane information and the program's pid |
pane_current_command, pane_current_path | Name and directory of the command currently running |
pane_dead, pane_in_mode | Always 0 (for tmux script compatibility; window_index and pane_index are always 0 too) |
cursor_x, cursor_y, alternate_on | Cursor position (from 0) and whether the alternate screen is in use |
history_size, history_limit | Number of scrollback lines and the limit |
version | zeropty version of the answering server (or embedded engine) |
These were checked against tmux on the same sessions. A format that uses only #{version} works without a session (zeropty display -p '#{version}' gives the running server's version; zeropty -V gives the CLI's own version). When -t names a session that does not exist, display-message prints the format with the session's variables empty and exits 0, as tmux does; to test whether a session exists, use has-session. Unknown variables become an empty string, as in tmux, and conditionals (#{?...}) and modifiers (#{t:...}) are not supported.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Failure: missing session (except display-message -t, see format variables), unknown option, wait-pane timeout or session end, "not found" from grep-panes or has-session, no server (no server running on ...) |
| 2 | Usage error: run without arguments, zeropty help <unknown command>, unknown argument to attach |