A pick typed in a shell runs there, keeping the shell's environment (FZTA-24) #208

Merged
merge-queue merged 2 commits from fzta-24-run-in-shell into main 2026-11-29 15:40:48 -08:00
Owner

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

Typing at in a shell, or fzt-automate resume-claude, used to hand the pick to tmux, which replaced the tab's program (killing that shell) and started the program from the tmux server's environment. Anything set in the shell, such as ANTHROPIC_API_KEY, was lost, so a Claude session could not be resumed on an API key.

Changed: when fzt-automate was started from a shell in the tab (tmux's pane_pid is not this process), the pick runs as that shell's child. It inherits the shell's environment and folder, and the prompt comes back when the program exits. This applies to the menu's pick (runHere), to the Claude launchers (respawnAs: launch-claude, resume-claude, work-on-app claude), and to Codex and OpenCode. While the child runs, fzt-automate ignores Ctrl+C and leaves it to the child.

Unchanged: where fzt-automate is the tab's own program (the Ctrl+T Ctrl+A tab, a takeover tab from the popup, a tab tmux restored with resume-claude <id>, claude-relaunch-with-chrome), tmux still restarts the tab as the program, so the tab closes with it.

Not covered: the popup menu (prefix menu) never sees a shell's environment. resume-claude is still a subcommand of fzt-automate, not a command you can type on its own.

Tested: unit tests for both paths, plus a real child run that checks the environment and folder are inherited. On a throwaway tmux server, typing the resume in a PowerShell tab with a key set started a fake claude with that key, in the same shell, and the prompt came back. Starting it as a tab's own program still restarted the tab as claude --resume <id>.

Work package: https://openproject.home.romaine.life/wp/FZTA-24 Typing `at` in a shell, or `fzt-automate resume-claude`, used to hand the pick to tmux, which replaced the tab's program (killing that shell) and started the program from the tmux server's environment. Anything set in the shell, such as `ANTHROPIC_API_KEY`, was lost, so a Claude session could not be resumed on an API key. **Changed:** when fzt-automate was started from a shell in the tab (tmux's `pane_pid` is not this process), the pick runs as that shell's child. It inherits the shell's environment and folder, and the prompt comes back when the program exits. This applies to the menu's pick (`runHere`), to the Claude launchers (`respawnAs`: launch-claude, resume-claude, work-on-app claude), and to Codex and OpenCode. While the child runs, fzt-automate ignores Ctrl+C and leaves it to the child. **Unchanged:** where fzt-automate is the tab's own program (the Ctrl+T Ctrl+A tab, a takeover tab from the popup, a tab tmux restored with `resume-claude <id>`, claude-relaunch-with-chrome), tmux still restarts the tab as the program, so the tab closes with it. **Not covered:** the popup menu (prefix menu) never sees a shell's environment. `resume-claude` is still a subcommand of fzt-automate, not a command you can type on its own. Tested: unit tests for both paths, plus a real child run that checks the environment and folder are inherited. On a throwaway tmux server, typing the resume in a PowerShell tab with a key set started a fake `claude` with that key, in the same shell, and the prompt came back. Starting it as a tab's own program still restarted the tab as `claude --resume <id>`.
A pick typed in a shell runs there, keeping the shell's environment (FZTA-24)
Some checks failed
Suite default / scope (pull_request) Has been cancelled
Suite default / check-fetches (pull_request) Has been cancelled
Suite default / check-rules (pull_request) Has been cancelled
Suite default / check-logs (pull_request) Has been cancelled
Suite default / reused-checks (pull_request) Has been cancelled
Suite go / scope (pull_request) Has been cancelled
Suite go / check-format (pull_request) Has been cancelled
Suite go / check-test-linux (pull_request) Has been cancelled
Suite go / check-test-windows (pull_request) Has been cancelled
Suite go / check-services (pull_request) Has been cancelled
Suite go / reused-checks (pull_request) Has been cancelled
Suite release / scope (pull_request) Has been cancelled
Suite release / module (pull_request) Has been cancelled
Suite release / reserve (pull_request) Has been cancelled
Suite release / finalize (pull_request) Has been cancelled
Suite release / pcs (pull_request) Has been cancelled
Suite release / pcs-prune (pull_request) Has been cancelled
Suite release / deliver (pull_request) Has been cancelled
Suite release / deliver-prune (pull_request) Has been cancelled
Suite release / publish (pull_request) Has been cancelled
Suite release / check-package (pull_request) Has been cancelled
Suite release / deploy-image (pull_request) Has been cancelled
Suite release / reused-checks (pull_request) Has been cancelled
079955cd4e
Merge branch 'main' into fzta-24-run-in-shell
All checks were successful
Suite release / publish (pull_request) Has been skipped
Suite release / pcs (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 17s
Suite release / scope (pull_request) Successful in 20s
Suite default / check-logs (pull_request) Successful in 17s
Suite release / check-package (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
Suite release / pcs-prune (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Successful in 16s
Suite go / check-test-linux (pull_request) Successful in 31s
Suite default / reused-checks (pull_request) Successful in 20s
Suite go / scope (pull_request) Successful in 17s
Suite default / check-fetches (pull_request) Has been skipped
Suite go / check-services (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 18s
Suite go / check-format (pull_request) Successful in 19s
Suite go / check-test-windows (pull_request) Successful in 1m29s
Suite go / reused-checks (pull_request) Successful in 13s
merge-queue landed on main
5d1dd3a545
merge-queue deleted branch fzta-24-run-in-shell 2026-11-29 15:40:48 -08:00
Sign in to join this conversation.
No description provided.