junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
61.81k stars 2.35k forks source link

Allow CTRL-C to cancel transform actions #3883

Closed junegunn closed 1 week ago

junegunn commented 2 weeks ago

the typical ⌃ Control + C keybind has no effect to cancel it.

All transform actions have the same problem. To allow CTRL-C, we should restore the terminal state to receive user input, but immediately doing so would cause unwanted artifacts to be rendered on screen during the execution. For example, if you hold down CTRL-K or up arrow during a transform action, you would see:

> ^K^K^K^[[A^[[A^[[A

One idea is to receive user input when a certain amount of time has elapsed, e.g. 1 second, assuming that most transform commands finish within the period.

Originally posted by @junegunn in https://github.com/junegunn/fzf/issues/3866#issuecomment-2180169823