Commit 7dd6b76
Fix interruption handling in nested shells
This change modifies the Shell.sh method to properly handle interruption signals
in nested shells by clearing and restoring the current pipe. When a user starts a
shell session, then runs the 'sh' command to create a nested shell, and then runs
a command like 'ttop' in that nested shell, pressing Ctrl+C now properly interrupts
the command.
This complements PR #411 which made the Pipe.setCurrentPipe method public to enable
this fix. Together, these changes resolve the issue reported in jline/jline3#1143
where interruption exceptions were not working for child sessions.
The fix follows the same pattern implemented in the Posix.runShell method, ensuring
consistent behavior across different shell creation methods.1 parent 69b7335 commit 7dd6b76
3 files changed
Lines changed: 42 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
811 | 812 | | |
812 | 813 | | |
813 | 814 | | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
814 | 819 | | |
815 | 820 | | |
816 | 821 | | |
| |||
822 | 827 | | |
823 | 828 | | |
824 | 829 | | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
825 | 837 | | |
826 | | - | |
| 838 | + | |
827 | 839 | | |
828 | 840 | | |
829 | 841 | | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
830 | 850 | | |
831 | 851 | | |
832 | 852 | | |
| |||
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
443 | 454 | | |
444 | 455 | | |
445 | 456 | | |
| |||
555 | 566 | | |
556 | 567 | | |
557 | 568 | | |
558 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
559 | 578 | | |
560 | 579 | | |
561 | 580 | | |
| |||
0 commit comments