PaneCommand
The line typed at a pane's shell to run one command to its end, and how its output is read back.
Source and package
- Qualified name
-
io.github .libtmux. Pane Command - Package
- io.github.libtmux
- Distribution
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/PaneCommand.java
-
Description#
Completion is not inferred from the screen. The command runs in a subshell whose trap prints an end marker carrying
$?and then signals a privatewait-forchannel through the same tmux binary and socket, so the wait is tmux's own and the status is the shell's. The trap covers interrupt and terminate as well as exit, so a command someone stops withC-cends the run and reports the status it was stopped with — commonly 130 — rather than leaving a wait with nothing to end it.The output is cut out by framing: a start marker is printed before the command and the end marker after it, and only lines strictly between them are returned. The shell echoes the whole typed line, which contains both markers — but only inside quotes, never as a line of its own that equals a marker, so matching complete marker lines tells plumbing from output even when the echo wraps.
Pane#run()is built on this, and it is public for a caller that needs the same framing around orchestration of its own — the MCP server holds a pane for other clients while a run is uncertain, which the library has no reason to.
Members8#
- channel method The
wait-forchannel the typed line signals once the command has ended. - frame method What lies between the two markers, and the status the end marker carried.
- Framed class A run's output as read back from the screen.
- fresh method A run with markers and a channel no other run shares.
- quote method One word, quoted so a POSIX shell reads it as exactly the text given.
- requirePosixShell method Refuses a pane whose shell would not read the typed line as written.
- status method The exit status a row carries at its end, or empty when the row does not end in one.
- typed method The line to type.