|
|
Log in / Subscribe / Register

Other features

Other features

Posted Apr 19, 2018 10:53 UTC (Thu) by Ross (guest, #4065)
In reply to: Other features by ewen
Parent article: A look at terminal emulators, part 1

Yes, that accurately describbes the functionality. As for references, that's the problem: I have very little information about it. It just sounds like something extremely useful.

I learned about it here: https://ttssh2.osdn.jp/manual/en/usage/tips/vim.html

So it's part of Tera Term, but I don't know where else it is implemented (if anywhere). The setting is private mode 7727 if that helps.

For reference, here's what the page says:

When the ESC key is pressed, Tera Term, xterm and other terminal emulator send the ESC(0x1b) key code. Also, when the cursor key and the function key is pushed, Tera Term sends the ESC key code. Therefore, the host application can not recognize whether the ESC key is pressed.
So, the vim waits for one second when the ESC key code is received to recognize what key is pressed. As a result, when a user presses the ESC key, the time for the insert mode exiting will be late for 1 second. This behavior can not be affected by enabling Changing cursor shape on entering and leaving into insert mode and Controlling IME.

Please use the Application Escape Mode to resolve this problem. When below contents is added in the .vimrc file, the insert mode is quickly exited after the ESC key is pressed.

let &t_SI .= "\e[?7727h"
let &t_EI .= "\e[?7727l"
inoremap <special> <Esc>O[ <Esc>


to post comments

Other features

Posted Apr 20, 2018 2:45 UTC (Fri) by ewen (subscriber, #4772) [Link]

Thanks for the explanation of the "application escape" mode. It looks like it's a custom control sequence which tells the terminal to make the ESC key press send a different (longer) code that the application can then recognise without waiting on a timeout. That's a clever idea, but one I don't think I've seen implemented anywhere else -- including on various hardware terminals. (I've used vi / vim for about 25 years at this point, and have just got used to expecting there'll be a delay between hitting ESC and actually coming out of insert mode, and delays in general -- at times I'm editing files via 300+ms RTT links, something that easily occurs when editing files on the other side of the world from where my terminal is running....)

Presumably if the terminal application was carefully enough programmed it could distinguish "ESC key pressed" and "CTRL-[" pressed, and invoke the magic "application escape" code only in the "ESC key pressed" case, and not in the "CTRL-[" case, thus leaving CTRL-[ as an option to insert literal 0x1b characters (eg, CTRL-V CTRL-[).

Ewen

Other features

Posted Mar 7, 2019 15:31 UTC (Thu) by nicm (guest, #50555) [Link]

> So it's part of Tera Term, but I don't know where else it is implemented (if anywhere).

To my knowledge nobody else implements it, although it is a nice idea so it would be good if other terminals pick it up.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds