syl20bnr / evil-escape

Customizable key sequence to escape from insert state and everything else in Emacs.
GNU General Public License v3.0
225 stars 42 forks source link

evil-escape sends duplicate/invalid key presses in some console programs #107

Open bcc32 opened 10 months ago

bcc32 commented 10 months ago

(Examples with evil-escape-key-sequence set to "fd")

In ansi-term and other term-buffers, when running less, if the user presses f, the file being viewed is actually scrolled down twice instead of once as it should be.

This is because evil-escape causes an f key press from the user to be sent as the following sequence of key presses:

f <backspace> f

In general, term-mode can be running some arbitrary program that doesn't interpret f <backspace> f as equivalent to f. In that case, it doesn't seem like evil-escape is completely safe to use in term-mode at all, since it's sending key sequences to an arbitrary terminal program that don't correspond to the user's intention.

Perhaps evil-escape-excluded-major-modes should include term-mode by default, as evil-escape's support for it works sometimes but is not correct in all cases.