You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A pipe can't help you with a REPL, a debugger, an ncurses installer, or a paged diff — those programs draw to a terminal and read keys, they don't read stdin and write stdout. macterm pane dump reads the terminal's own cells, so a script outside the pane can see exactly what's on screen and type into it.
Three verbs:
pane run <text>
Type text plus a newline into a live pane's shell or REPL
pane key <chord>
Send one encoded keypress — ctrl+c, ctrl+d, escape, up
pane dump
Print what the pane is displaying (add --scrollback for history)
Wrap anything with a redirect in /bin/sh -c '…'. Text you type lands in the user's shell, and shells disagree: in nushell > is a comparison operator, not a redirect, so a bare echo ok > /tmp/done silently writes no file. Single quotes are fine when typing directly into a pane.
Polling the screen for a marker works too, but the line you typed is echoed on screen, so a naive grep matches your own command. Assemble the marker at runtime — type printf done-%s $NONCE so the joined string only ever exists in the output.
The same three verbs are what let an AI agent work in a terminal it isn't running inside: pane run to act, pane dump to see the result — including from programs whose output never reaches a pipe.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
A pipe can't help you with a REPL, a debugger, an ncurses installer, or a paged diff — those programs draw to a terminal and read keys, they don't read stdin and write stdout.
macterm pane dumpreads the terminal's own cells, so a script outside the pane can see exactly what's on screen and type into it.Three verbs:
pane run <text>pane key <chord>ctrl+c,ctrl+d,escape,uppane dump--scrollbackfor history)Worked example: feed a REPL, read the answer
Editor in pane 1, REPL in pane 2:
pane key ctrl+dexits the REPL;pane key ctrl+cinterrupts whatever is running.Targeting
--pane pane:2is the 1-based index within the active tab — stable for a fixed split, and the easiest way to mean "the pane next to me".--session macterm-…is restart-stable: pane UUIDs regenerate every launch, session names persist. Get them frommacterm pane list.$MACTERM_SESSIONis already its own session, so a baremacterm pane splitself-targets.Wait for a sentinel, not a sleep
There's no reliable "is it done" signal to poll — so have the command leave a mark and wait for that:
Wrap anything with a redirect in
/bin/sh -c '…'. Text you type lands in the user's shell, and shells disagree: in nushell>is a comparison operator, not a redirect, so a bareecho ok > /tmp/donesilently writes no file. Single quotes are fine when typing directly into a pane.Polling the screen for a marker works too, but the line you typed is echoed on screen, so a naive
grepmatches your own command. Assemble the marker at runtime — typeprintf done-%s $NONCEso the joined string only ever exists in the output.The same three verbs are what let an AI agent work in a terminal it isn't running inside:
pane runto act,pane dumpto see the result — including from programs whose output never reaches a pipe.All reactions