#1668
Resume a running turn when its window closes before SIGHUP
Summary
- Closing the terminal window while fx is working on a request no longer saves the turn as cancelled, so
fx --resume lastandfx -csend the request again on their own. - When fx sees the window close before SIGHUP arrives, it saves the request as a clean close, the same as when SIGHUP arrives first.
- Closing the window while fx is idle still shuts fx down normally.
- Esc, Ctrl+C twice, and /quit still cancel the running request, and reopening does not send it again.
Activity
1This pull request is a draft
Merging is unavailable until it is marked ready for review.
The first CI attempt failed E2E shard 3/4 in
tui-full-transcript-brutal.test.ts("Ctrl-O repeatedly survives mixed long chats, dense tool batches, live output, resize storms, and resume"), on both its run and its retry: line 973 countedCTRL_O_BRUTAL_HISTORY_DONEtwice in the first session's scrollback. That check runs before the test closes any window, and this change only acts after the terminal hangs up. The same failure at the same line happened in an unrelated PR's run (fazxes/test-pgso-transformed-code, run 42073250969) and passed on retry there. A rerun of the failed jobs on this commit passed with no retry warnings.