Hi Shiji Yang,
On 12/28/25 6:25 AM, Shiji Yang wrote:
Check Ctrl-C status before executing each command in the pipeline so
that the Ctrl-C can skip all subsequent commands. This should be the
default behavior of most shells.
Before the change:
```
=> echo start; while true; do echo loop; sleep 1; done; echo int; if true; then
echo if; fi; echo stop
start
loop
loop <-- Input Ctrl-C
int
if
stop
=>
```
After the change:
```
=> echo start; while true; do echo loop; sleep 1; done; echo int; if true; then
echo if; fi; echo stop
start
loop
loop <-- Input Ctrl-C
^C
=>
```
Signed-off-by: Shiji Yang <[email protected]>
---
common/cli_hush.c | 21 +++++++++++++--------
I'm assuming we want the same behavior on all shells. So if this were to
be merged, a similar implementation needs to be done for cli_hush_modern
as well.
Any chance we can get a test for this in test/hush/? I don't know if we
can send the ctrl-c keystroke (the pytest test suite can, but test/hush
is C code...).
Cheers,
Quentin