Repository navigation
Interactive services: run -i (PTY + holder), log-view input, attach, send, reload (#68) - #76
Merged
Merged
Conversation
FIFO-based stdin for services started with --interactive/-i (Unix): the service reads the FIFO read-only and inherits an extra write end, so it never sees EOF and no taba process stays behind. taba send, taba attach and taba signal follow the stop ownership rules (owner, exclusive borrow, or --force --reason). ps --json reports "input". taba ui: i attaches. Design under review on #68 (PTY + holder); not ready to merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 26, 2026
Let interactive dev servers take input: run --input, taba send, taba attach (Flutter hot reload)
#68
Closed
…#68) - Interactive services get a pseudo-terminal as stdin (stdout/stderr still go to the log). A per-service holder (`taba __hold`) keeps the PTY master open, forwards the input FIFO into it, drains it and exits with the service. Echo is off; the PTY is not the controlling terminal. - `run -i/--interactive`, `--no-interactive`; `flutter run` and `vite` (also via npm/pnpm/yarn/bun scripts) are interactive by default and the reply says `interactive: yes`. - `taba logs -f` on a terminal is read-only until `i`; Ctrl+] stops typing, q quits. `taba attach` opens it in input mode; `i` in `taba ui` too. - `taba reload [--restart]`: Flutter SIGUSR1/SIGUSR2, Vite `r` + Enter; E_NO_RELOAD otherwise. - `ps --json` field is `interactive`. Windows: E_UNSUPPORTED (#79); fixes the unused-constant build error on windows-latest. - Tests, README section, SKILL.md hot-reload section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
taba.toml services take `interactive = true/false` (unset: detected as for `run`); detection uses the service's effective directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…68-interactive-input
…teractive76 # Conflicts: # src/main.rs # src/runform.rs
Buchi-dev-dzn
marked this pull request as ready for review
November 26, 2026 17:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #68. Windows follow-up: #79.
Lets dev servers that take keys while they run (
flutter run:rhot reload,Rhot restart; Vite:r+ Enter,h+ Enter) be driven through taba, by people (log view /attach/taba ui) and by agents (taba reload,taba send).Review hardening (
64f6480)flutter runprocess leader on Linux. On macOS,taba reloadandtaba reload --restartreturnE_NO_RELOADwithout sending a signal. Usetaba attach S/Nand pressr(reload) orR(restart), or usetaba send S/N --key r/--key R.taba stop S/N, then rerun the original command with the same name, options and arguments, adding--interactivebefore the service command (replace--no-interactiveif present). Then attach or send the key. This restores manual input; it does not make a wrapper a supported signal target.64f6480:cargo fmt --check,cargo clippy --all-targets -- -D warnings, andcargo test -- --test-threads=1with a disposableTABA_HOMEall passed (198 tests passed, 3 ignored).Owner decisions (final, 2026-11-26, see #68)
--interactive/-i, plus--no-interactive. Not--input./dev/null, no extra process).flutter runandviteare interactive automatically, andrunsaysinteractive: yes.Design
process.stdin.isTTY, so a FIFO does not work for it. Flutter accepts a FIFO, but one mechanism for everything is simpler and behaves like a terminal for every tool, so every interactive service uses the PTY. The FIFO is still there, as the holder's input channel. stdout and stderr still go to the log file, so logs look the same as for any other service (tools see a non-terminal stdout and keep their output plain).taba __hold MASTER FIFO PID PGID START):runstarts it right after the service, in its own session, with the PTY master and the FIFO's read end as its only inherited descriptors. It copies the FIFO into the master, drains the master (echo is off, so this is normally empty), and exits as soon as the service's process group is gone (it checks every 200 ms with the same pid + start-time identity check thatstopuses). Its pid and start time are in the service record (input.holder_pid,input.holder_start_time). If the holder cannot start,runstops the service and fails.taba stop). A dead holder is reported asE_NO_INPUT("its input holder (pid N) is gone").send,attach,i),reloadandsignaluse the same rules asstop: the owning scope under its lease, or the holder of an exclusive borrow; anyone else getsE_NOT_OWNERunless--force --reason(recorded asforce_send,force_attach,force_reload,force_signal). The owner getsE_LOCKEDwhile another scope holds&mut.input::detect):flutter … run(alsofvm flutter run, a full path,flutter.bat),vite/vite preview/npx vite/node …/vite.js(notvite build), words insidesh -c '…', and one level of package.json scripts fornpm run X/npm start/pnpm X/yarn X/bun run X. Only on macOS and Linux; on Windows they start as before.User-facing changes
taba run -i/--no-interactive"interactive": true(JSON) /interactive: yes (type: taba attach S/N; i in taba logs -f)(text). Re-running with a different interactive mode isE_CONFLICT.taba logs -f S/Nienters input mode (a bar saysINPUT MODE),Ctrl+]goes back to read-only,q/Ctrl+Cquits. The service keeps running. Unchanged for pipes and for non-interactive services.taba attach S/Ntaba uiion an interactive service (list or its log view): the log view in input mode;Ctrl+]returns to the UI. Footer showsi inputwhen it applies.taba reload S/N [--restart]flutter runleader: SIGUSR1 (hot reload) / SIGUSR2 (--restart, hot restart); no stdin needed. macOS Flutter:E_NO_RELOAD, user/Rinstead. Vite dev:r+ Enter (restarts the server; open pages reload). Vite preview and unsupported targets:E_NO_RELOAD. JSON:kind,method.taba send S/N TEXT [--no-newline]/--key K--key enternow sends CR, as a terminal's Enter key does (the PTY turns it into\nfor line readers).taba signal S/N USR1|USR2|HUPtaba.toml/taba upinteractive = true/false(unset: detected as forrun, in the service'scwd).ps --json"interactive": true/false(renamed from the draft'sinput, to match the flag).E_NO_RELOAD(3). From the draft:E_NO_INPUT(3),E_NOT_RUNNING(3),E_INPUT_BLOCKED(1),E_UNSUPPORTED(1).Earlier Mac smoke tests (before review hardening)
macOS, Flutter 3.50.0, Vite 8.3.8, Node 26; throwaway
TABA_HOME.Flutter web:
flutter create --platforms web, thentaba run --name app --wait=240 --ready "log:Flutter run key commands" -- flutter run -d chrome --web-browser-flag=--headless=new:interactive: yes; ready check passed after 48 s.taba send app --key r→Performing hot reload...;--key R→Restarted application in 327ms.taba reload appandtaba reload app --restartsignaled successfully in this setup. The current macOS behavior isE_NO_RELOAD; use the keys above.taba logs -f appin a real PTY (driven by a Pythonpty.forkscript):rin read-only mode was ignored,i→ INPUT MODE,r→Reloaded application in 299ms,Ctrl+]→ read-only again,rignored,q→ exit 0, app still running.taba stop app: the holder,flutter_tools, the frontend server and headless Chrome were all gone afterwards (pgrep).Flutter run key commandsis printed before the browser's debug client connects. The firstrsent right after the ready check only recompiled (Recompile complete. No client connected.). The README and SKILL.md keep the requested--ready "log:Flutter run key commands", and say to wait forlog:Dart VM Service on Chrome is availablewhen a script reloads right after start.Vite:
package.jsonwith"dev": "vite",taba run --name web --port auto --wait=30 -- npm run dev -- --port '{port}' --strictPort:interactive: yes; Vite printedpress h + enter to show help, which it only does when stdin is a TTY.taba send web h→ the shortcut list;taba reload web→[vite] server restarted.taba stop web: holder gone.The draft's earlier finding still holds and is the reason for the PTY: with only a FIFO, Vite never binds its shortcuts (
process.stdin.isTTYis undefined).Tests
tests/input.rs(Unix; a Windows test checksE_UNSUPPORTED):attachfrom a pipe;signal;already_runningvsE_CONFLICTon a different interactive mode; afterstopthe holder exits andsendisE_NOT_RUNNING;rmremoves the FIFO.E_NO_INPUTforsend/attach;signalstill works.E_NOT_OWNERfor send/attach/signal/reload,--forceneeds--reason, forced send recorded, exclusive borrower may send, ownerE_LOCKED.flutter(cbreak keys, SIGUSR1/SIGUSR2): auto-interactive,interactive: yesin the text reply, a single key arrives without Enter, Linux signal reload/restart vs. macOSE_NO_RELOAD, and--no-interactive(stdin EOF,E_NO_INPUT).vite(line shortcuts): auto-interactive, stdin is a TTY,reloadsendsr; a plain service givesE_NO_RELOAD.itypes,Ctrl+]stops typing,qquits, the service keeps running.sh -c/package scripts), keys, CRLF;taba ui:ionly on a running interactive service.Windows
run -i,send,attach,reload,signalreturnE_UNSUPPORTED, and the message points to Interactive services on Windows (ConPTY): run -i, send, attach, reload #79 (ConPTY follow-up). Auto-detection is off on Windows, soflutter run/vitestart as before.constant WRITE_TIMEOUT is never used) is fixed with a Unix-only constant. Windows CLI parsing also needed an explicit 8 MiB dispatch-thread stack: the expanded Clap command tree overflowed the default Windows main-thread stack in integration tests. CI now builds, runs Clippy and passes all tests on Windows.Limits and follow-ups
\rprogress lines intaba logs(with--rawfor the original). Because stdout is still a file, Flutter and Vite already write plain text, so this is left out of this PR; worth a separate issue if colored tools show up.taba stopis the way to stop it.reloadknows Flutter and Vite only; other tools usetaba send --key.🤖 Generated with Claude Code
Update to main (4e3e7b7, Windows/WSL owner: N.A.V.i)
Merged
origin/main(3f2e388: shorttaba run CMDform #74,discovered_ports, sha2 bump #81, action bumps) into this branch; merge commit, no force-push, no history rewritten. Conflicts resolved so both sides keep working:RunArgs: main's terminal-confirmation flag (interactive: bool, "offer the corrected command") is renamedprompt; this PR'sinteractive: Option<bool>(-i/--no-interactive/ detected) keeps its name. Interactive detection runs in main's newrun_service, so it applies to the short form, the explicit form andtaba up.Servicekeeps bothdiscovered_portsandinput;run --jsonhas bothdiscovered_portsandinteractive.taba-mainthread stays and wraps main's newrunform::prepare+try_parse_from.runformknows-i,--interactive,--no-interactiveasrunswitches, sotaba run "flutter run" -iandtaba run -i viteparse like other taba options (new unit test;runform_knows_every_run_flagnow also checks short switches).interactive: yes (type: taba attach NAME; i in taba logs -f).tests/short_run.rs: the explicit-form JSON key list includesinteractive.Checks at 4e3e7b7
-D warnings, all tests).tests/input.rs: 7/7 on macOS and Ubuntu (incl. the real-PTY log-view test), 1/1 on Windows (E_UNSUPPORTED). Release candidate run 45809600343: all package jobs, advisories and archive verification passed.cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(all suites pass). DisposableTABA_HOME:run -i→E_UNSUPPORTED(points to Interactive services on Windows (ConPTY): run -i, send, attach, reload #79),send→E_UNSUPPORTED,reloadof a plain service →E_NO_RELOAD, short and explicit forms start non-interactive (interactive: false),stopworks.cargo fmt --check, Clippy,cargo test(all suites;input7/7). Plus a disposable smoke script (throwawayTABA_HOMEin/tmp, fakeviteas apackage.jsonscript and a fakeflutterin Python; no real Flutter/Vite, no installed binary):taba run npm run dev(short form) andtaba run --name web --port auto -- npm run dev -- --port '{port}': auto-interactive,interactive: yesprinted,ps --jsoninteractive: true; the fake Vite sawisTTY=true.send web h→ help;reload web→method: stdin,[vite] server restarted.send/reload→E_NOT_OWNER(exit 3),--forcewithout--reason→E_FORCE_NEEDS_REASON; viewing its log works.send --key rarrives as one key without Enter;reload→ SIGUSR1,reload --restart→ SIGUSR2.taba logs -f appin a real PTY (pty.fork): key in read-only mode dropped,ishowsINPUT MODEand types,Ctrl+]stops typing,qexits 0, service still running.stop: every holder pid gone,send→E_NOT_RUNNING, no leftover processes from the fixture.Platform limits (unchanged)
E_UNSUPPORTEDand detection is off; ConPTY is Interactive services on Windows (ConPTY): run -i, send, attach, reload #79.tests/project.rs::up_stops_at_first_failure_and_keeps_earlier_servicesleaves itspython -m http.serverrunning on Windows; it inherits the test's output pipe, socargo test | grepwaits until it is killed. Redirecting to a file avoids the hang.Owner review required before merge.
Previous validation (ac8e6d4)
cargo fmt --check,git diff --check, andcargo test --test input(7 passed). Full local builds were stopped when available disk fell below 2 GiB; CI provided the full cross-platform validation. No local Flutter service was started during the final Windows fix; the real Flutter and Vite runs documented above were completed earlier on this PR.