3 ms·
Somehow online vi clones never bother with implementing ^[ (does the same as escape), which seriously impairs me. Is this impossible to implement?
by filipncs 14y ago
Somehow online vi clones never bother with implementing ^[ (does the same as escape), which seriously impairs me.
Is this impossible to implement?
- tagx 14y agoThis is implemented. It works for me in chrome
- filipncs 14y agoYou're right, thank you. At least it works on chrome on osx. It didn't work when I tested it earlier in dev channel chrome on windows.
- filipncs 14y agoJust in case you're still scanning the comments: It works on OSX because it appears the operating system automatically creates a keypress of scancode 27 (escape) when you press "^[". The special code in term_keypress_inner to handle this combination of keys is never hit, because no keypress event is created for ^[, but it isn't necessary on OSX due to the above feature. You could expand your handling of keyup/keydown to handle it. For example, change your keyup handler to the following: $(document).keyup(function(e) { if(e.keyCode === 27 || (e.ctrlKey && e.keyCode === 219)) { do_escape(); } });
- a3_nm 14y agoSame for ^C, which also does the same as Esc and is extremely convenient to type. (There is a slight difference with Esc though: VjjIblah^C does not do the same as VjjIblah<Esc>.)