Repository navigation
Let Ctrl+C in the Stata pane stop a command Stata runs through shell - #447
Conversation
The sight-pty helper sent SIGINT to Stata's pid only. Stata waits for what its shell runs, so Ctrl+C during `shell sleep 60` did nothing until the sleep ended. Send it to the process group, as a terminal's ^C would, like the helper's hang-up and kill already do.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Ctrl+C in the Stata pane didn't break a long-running command when Stata was running it through
shell(or!).shell sleep 60kept going until the sleep finished.The sight-pty helper sent SIGINT only to Stata's pid. Stata waits for whatever its
shellstarted, so nothing happened until that child ended. The helper now sends SIGINT to Stata's process group, as a terminal's ^C does. This matches what it already does for hang-up and kill. The Perch console (tty.js) uses the same helper, so it gets the fix too.Proof:
shell sleep 60did nothing.sleepis left behind.--Break--forsleep 20000, a Mata loop,while 1 {}, and a loop that floods output.bun test ./testspass (10520 tests, 0 failures).Not changed: the Bun PTY that the command-line
sight consoleuses has a similar gap. Its Stata shares the console's own process group, so it needs a different fix.Reviewed with sol-loop: 1 round with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code).
Summary by CodeRabbit
shellor!, rather than only interrupting the directly launched command. This also helps foreground child processes respond to the interrupt.