Testing & Automation
MonoTerm has two interfaces for automation:test for UI verification
and ctl for controlling a running instance. Both are currently available on
macOS and Linux only. The interactive MonoTerm TUI also ships for Windows, but
Windows ctl and test return a non-zero error until named-pipe and ConPTY
transports are implemented.
monoterm test
monoterm test spawns a fresh MonoTerm in a real pseudo-terminal and sends
keystrokes through the same path as a human typing. It does not require a human
to operate the terminal.
test key recognizes @, tab, esc, enter, j, k, arrow keys,
ctrl+b, and arbitrary text. It is a one-event screen probe, not the complete
suite.
Example: verify prompt box opens
Complete automated suite
The default,auto, and all forms run 28 checks across 16 ordered sections:
The harness polls for the required UI state within a bounded timeout. It does
not accept a single fixed-delay snapshot, which could capture a partially drawn
prompt or autocomplete redraw.
Mouse pipeline probe
monoterm test mouse injects SGR right-click sequences into the test PTY and
passes only when MonoTerm parses those bytes and renders its menu. A pass proves
the MonoTerm parser/rendering path; it does not prove that a particular host
terminal forwards mouse events.
monoterm ctl
monoterm ctl controls the newest live MonoTerm instance through a
newline-delimited JSON Unix socket. It cleans sockets whose owning process has
exited. These commands bypass MonoTerm keybindings and operate at the PTY layer.
~/Library/Application Support/Monolex/runtime/sockets/monoterm/control-{PID}.sock.
ctl read defaults to %, which matches the default zsh prompt; pass '$' for
a typical bash prompt or supply another query.
ctl tabs is a tab-label view. In 0.4.17, its per-row sessionId repeats the
active session ID; raw session-list owns the real session inventory. The raw
parser also accepts 11 messages, but tab-new, tab-switch, and tab-close
currently fail closed, while simulate-key executes only PTY mappings and
selected non-blocking actions. See the raw protocol table
before building directly on the socket.
Example: run a command and read output