Stay running for tmux, which draws the menus it asks for (--serve) #228

Merged
merge-queue merged 3 commits from resident-serve into main 2026-12-01 01:35:12 -08:00
Owner

Adds fzt-automate --serve: fzt-automate stays running and runs the at menu for tmux over its standard input and output, so opening the menu no longer starts a program each time. Starting one cost 60 to 200 ms before the menu drew; in a running program the menu draws in a few.

Added

  • serve.go: the frames tmux and fzt-automate exchange (open a menu with its size, arguments and standard input; input; resize; close; draw; exit with code and standard output; quit). Each menu runs as --popup would, on a tcell screen of its own over that pipe (tui.RunLoopOn, from fzt-terminal). Several menus can be open at once.
  • When a release replaces the installed program, the running copy waits until no menu is open and then tells tmux, which starts the new release in its place.
  • Its output is tmux's pipe, so anything else it would print is dropped. A menu that panics is recorded in the failure log through logline.

Changed, with no change in behaviour

  • main.go's menu setup is split into menu.go (parseMenuArgs, menuConfig, popupMain), so --popup and --serve share it. runPopup takes an optional screen.

Not changed: --popup started directly works as before, and nothing uses --serve until at-tmux's display-palette -S does. That change is the next PR and has to land after this one is released.

Tests: TestServedPopupPicksTmuxRow runs --serve as a process and picks one of tmux's rows through the frames. Two menus at once, tmux closing a menu, the quit after a release once the last menu ends, refusing anything but --popup, and Escape arriving as CSI 27 u are tested in process.

Work package: https://openproject.home.romaine.life/wp/FZTA-25

🤖 Generated with Claude Code

Adds `fzt-automate --serve`: fzt-automate stays running and runs the at menu for tmux over its standard input and output, so opening the menu no longer starts a program each time. Starting one cost 60 to 200 ms before the menu drew; in a running program the menu draws in a few. **Added** - `serve.go`: the frames tmux and fzt-automate exchange (open a menu with its size, arguments and standard input; input; resize; close; draw; exit with code and standard output; quit). Each menu runs as `--popup` would, on a tcell screen of its own over that pipe (`tui.RunLoopOn`, from fzt-terminal). Several menus can be open at once. - When a release replaces the installed program, the running copy waits until no menu is open and then tells tmux, which starts the new release in its place. - Its output is tmux's pipe, so anything else it would print is dropped. A menu that panics is recorded in the failure log through logline. **Changed, with no change in behaviour** - `main.go`'s menu setup is split into `menu.go` (`parseMenuArgs`, `menuConfig`, `popupMain`), so `--popup` and `--serve` share it. `runPopup` takes an optional screen. **Not changed:** `--popup` started directly works as before, and nothing uses `--serve` until at-tmux's `display-palette -S` does. That change is the next PR and has to land after this one is released. Tests: `TestServedPopupPicksTmuxRow` runs `--serve` as a process and picks one of tmux's rows through the frames. Two menus at once, tmux closing a menu, the quit after a release once the last menu ends, refusing anything but `--popup`, and Escape arriving as CSI 27 u are tested in process. Work package: https://openproject.home.romaine.life/wp/FZTA-25 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fzt-automate --serve runs the popup menu for tmux over its standard input
and output, a session per menu on a screen of its own, so opening the at
menu starts no program (FZTA-25).
Record a served menu's panic in the failure log, through logline
All checks were successful
Suite release / scope (pull_request) Successful in 7s
Suite release / module (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 6s
Suite default / check-logs (pull_request) Successful in 6s
Suite go / check-format (pull_request) Successful in 8s
Suite release / deliver-prune (pull_request) Has been skipped
Suite go / scope (pull_request) Successful in 5s
Suite release / check-manifest (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite go / check-test-linux (pull_request) Successful in 11s
Suite go / check-services (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Successful in 5s
Suite go / reused-checks (pull_request) Successful in 4s
Suite default / scope (pull_request) Successful in 5s
Suite release / reserve (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite default / reused-checks (pull_request) Successful in 5s
Suite default / check-fetches (pull_request) Has been skipped
Suite release / check-package (pull_request) Successful in 8s
Suite go / check-test-windows (pull_request) Successful in 46s
merge-queue landed on main
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Successful in 12s
6f5d686623
merge-queue deleted branch resident-serve 2026-12-01 01:35:12 -08:00
Sign in to join this conversation.
No description provided.