Skip to content

Instantly share code, notes, and snippets.

@saitoha
Last active January 3, 2016 15:49
Show Gist options
  • Select an option

  • Save saitoha/8485847 to your computer and use it in GitHub Desktop.

Select an option

Save saitoha/8485847 to your computer and use it in GitHub Desktop.
Add the support for application escape mode
let &t_ti = &t_ti . "\e[?7727h"
let &t_te = "\e[?7727l" . &t_te
nmap <t_kx> <Esc>
imap <t_kx> <Esc>
vmap <t_kx> <Esc>
cmap <t_kx> <Esc>
omap <t_kx> <Esc>
diff -r a42040fed96c src/keymap.h
--- a/src/keymap.h Tue Jan 14 21:31:34 2014 +0100
+++ b/src/keymap.h Sat Jan 18 12:05:19 2014 +0900
@@ -405,6 +405,8 @@
#define K_K8 TERMCAP2KEY('K', 'K') /* keypad 8 */
#define K_K9 TERMCAP2KEY('K', 'L') /* keypad 9 */
+#define K_APPESC TERMCAP2KEY('k', 'x') /* alternate escape key */
+
#define K_MOUSE TERMCAP2KEY(KS_MOUSE, KE_FILLER)
#define K_MENU TERMCAP2KEY(KS_MENU, KE_FILLER)
#define K_VER_SCROLLBAR TERMCAP2KEY(KS_VER_SCROLLBAR, KE_FILLER)
diff -r a42040fed96c src/term.c
--- a/src/term.c Tue Jan 14 21:31:34 2014 +0100
+++ b/src/term.c Sat Jan 18 12:05:19 2014 +0900
@@ -1000,6 +1000,11 @@
{K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
{K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
+ /* The alternate escape key code called as "application escape".
+ * http://code.google.com/p/mintty/wiki/CtrlSeqs#Escape_keycode
+ */
+ {K_APPESC, IF_EB("\033O*[", ESC_STR "O*[")},
+
{BT_EXTRA_KEYS, ""},
{TERMCAP2KEY('k', '0'), IF_EB("\033[10;*~", ESC_STR "[10;*~")}, /* F0 */
{TERMCAP2KEY('F', '3'), IF_EB("\033[25;*~", ESC_STR "[25;*~")}, /* F13 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment