aperezdc / zsh-fzy

Use the fzy fuzzy-finder in Zsh
MIT License
55 stars 9 forks source link

Esc to abort #8

Closed noscript closed 5 years ago

noscript commented 6 years ago

Thanks for nice write up. Any idea how bind Esc to abort fzf-history-widget?

aperezdc commented 6 years ago

@noscript: Sorry, I don't really know how to make Zsh intercept the key itself. As far as I understand, fzy should handle the Esc key itself.

noscript commented 6 years ago

As far as I understand, fzy should handle the Esc key itself.

Not at the moment, but hopefully it will in the future.

aperezdc commented 6 years ago

@noscript: You're right! I have just tried and indeed it does not handle Esc! I am so used to cancel fzy using Ctrl-C that I hadn't noticed :innocent:

I am not even sure that it's possible to hace Zsh handle the Esc key while fzy is being executed, because if I understand correctly, fzy will be in control of the terminal — at least there is no way I could find out searching a bit around and reading the Zsh manual :disappointed:

If somebody with more knowledge about Zsh could give some hint, that would be great.

noscript commented 6 years ago

There is the relevant issue https://github.com/jhawthorn/fzy/issues/65

I understand correctly, fzy will be in control of the terminal

That is my understanding too. It is possible to rebind SIGINT to Esc like so

stty intr '^['

but that doesn't work for zle widgets.

maximbaz commented 5 years ago

This works out of the box now, the issue can be closed.