Commit 0aba31b
Add ctrl-c e2e test and handle SIGINT gracefully in vt
Add a `vtt exit-on-ctrlc` subcommand and e2e fixture that verifies SIGINT
propagates to concurrent tasks when the user presses Ctrl+C. The test runs
two packages with `vt run -r dev`, synchronizes via milestone protocol,
then sends ctrl-c and verifies both tasks receive and handle it.
Handle SIGINT/CTRL_C gracefully in vt: ignore the signal in the parent
process (so it survives Ctrl+C) while resetting to SIG_DFL in pre_exec
for child processes (so they can install their own handlers). This lets
vt wait for tasks to exit and report their actual exit status.
Also adds `ctrl-c` as a new `write-key` interaction type, fixes
`expect_milestone` to preserve unmatched milestones, and strips `^C`
terminal echo in redaction for cross-platform consistency.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c100c3b commit 0aba31b
File tree
4 files changed
+33
-6
lines changed- crates
- vite_task_bin
- src
- tests/e2e_snapshots
- fixtures/ctrl-c/snapshots
- vite_task/src/session/execute
4 files changed
+33
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
563 | 564 | | |
564 | 565 | | |
565 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
11 | 25 | | |
12 | 26 | | |
13 | 27 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
| |||
0 commit comments