Commit a00bca5
fix: use ctrlc crate for cross-platform Ctrl+C detection in pty test
Replace platform-divergent signal-hook (Unix) / default-handler (Windows)
approach with the `ctrlc` crate on both platforms. The handler writes
"INTERRUPTED" and exits directly, avoiding race conditions between the
callback thread and main thread.
On Windows, the Rust runtime sets SetConsoleCtrlHandler(NULL, TRUE) during
init which ignores CTRL_C_EVENT — clear this flag before registering the
handler so ConPTY-generated events reach it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 2fc7fdb commit a00bca5
File tree
4 files changed
+83
-54
lines changed- crates/pty_terminal
- tests
4 files changed
+83
-54
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 369 | + | |
379 | 370 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 371 | + | |
| 372 | + | |
392 | 373 | | |
393 | 374 | | |
394 | 375 | | |
| |||
399 | 380 | | |
400 | 381 | | |
401 | 382 | | |
402 | | - | |
| 383 | + | |
403 | 384 | | |
404 | 385 | | |
405 | 386 | | |
406 | 387 | | |
407 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
408 | 398 | | |
409 | 399 | | |
410 | 400 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
422 | 404 | | |
423 | | - | |
424 | | - | |
425 | 405 | | |
426 | 406 | | |
427 | 407 | | |
| |||
432 | 412 | | |
433 | 413 | | |
434 | 414 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
| 415 | + | |
| 416 | + | |
441 | 417 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
| 418 | + | |
452 | 419 | | |
453 | 420 | | |
454 | 421 | | |
| |||
0 commit comments