Page 3 of 3

Re: how does vim distinguish ESC key from the escape sequenc

Posted: Thu Aug 30, 2018 7:45 am
by Brendan
Hi,
Sik wrote:I honestly hate how terminals handle keystrokes for anything that isn't a normal character. I get it about old terminals, but how come none of the extensions over time ever fixed this mess? >​:​|
That's easy: it'd be like building a cable car on Mount Everest to make it easy for people to reach the top. Anything that makes the user interface slightly more user-friendly removes the ability for people to brag about mastering one of the worst possible user interfaces ever designed, so it'd ruin the entire point of using VIM in the first place.


Cheers,

Brendan

Re: how does vim distinguish ESC key from the escape sequenc

Posted: Thu Aug 30, 2018 8:58 am
by Solar
My, aren't we confrontational today?

Nobody is trying to force you into using Vim, or anything other than your editor (or language, or compiler, or operating system, or interface in general) of choice.

Could you please refrain from calling those who made other choices than you names?

Re: how does vim distinguish ESC key from the escape sequenc

Posted: Thu Aug 30, 2018 11:56 am
by Sik
Yeah, my complaint wasn't even about vim (which I don't like but that's another topic), it was about terminal protocols themselves. It makes it a freaking pain to make TUI programs. It's not just the users who get screwed over it, it's also the developers who now have to restrict what they're allowed to do. That's not fun.

Amusingly, my suggestion would have made things easier for vim (as it could just check for CAN instead of doing the timing stuff and hope the stream isn't too laggy to screw that up). One can dream.

Re: how does vim distinguish ESC key from the escape sequenc

Posted: Fri Feb 01, 2019 6:25 pm
by eekee
Wow! So much waffle! And this from a guy who's waffled more than anyone else today! :twisted:

The simple answer to the original question is plainly visible if you use any vi in a TTY: it waits to see if there's a character coming immediately after the escape.

I've repeatedly found that delay to be a nuisance, temporarily confusing and alarming me as the editor gets behind my typing, and I curse the day DEC decided to use the escape character in their key sequences. It throws off my train of thought!

As for why it's such a long delay, I can only imagine it's designed to work with 75 baud serial lines, or maybe laggy ssh sessions.