The disambiguate flag means that:
In particular, ctrl+c will no longer generate the SIGINT signal, but instead be delivered as a CSI u escape code.
so cancellation only works while we turn off disambiguation.
We turn it off while running external commands that want to claim the TTY.
Also we do it (only as a workaround for this issue) while expanding wildcards or while running builtin wait.
There are other cases where we don't have a workaround, like in trivial infinite loops or when opening a fifo.
One approach is to add a separate thread for handling input, then we can process keys while the main thread is busy.
The disambiguate flag means that:
so cancellation only works while we turn off disambiguation.
We turn it off while running external commands that want to claim the TTY.
Also we do it (only as a workaround for this issue) while expanding wildcards or while running builtin
wait.There are other cases where we don't have a workaround, like in trivial infinite loops or when opening a fifo.
One approach is to add a separate thread for handling input, then we can process keys while the main thread is busy.