comparison src/term.c @ 10640:27be410d6d29 v8.0.0210

patch 8.0.0210: no support for bracketed paste commit https://github.com/vim/vim/commit/ec2da36ca48b40c0654b32a8d2c9f52e796daa5e Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 21 20:04:22 2017 +0100 patch 8.0.0210: no support for bracketed paste Problem: Vim does not support bracketed paste, as implemented by xterm and other terminals. Solution: Add t_BE, t_BD, t_PS and t_PE.
author Christian Brabandt <cb@256bit.org>
date Sat, 21 Jan 2017 20:15:04 +0100
parents 675dfe47ab69
children b8c04c007d39
comparison
equal deleted inserted replaced
10639:9b3141c5aa1b 10640:27be410d6d29
855 # ifdef FEAT_TERMGUICOLORS 855 # ifdef FEAT_TERMGUICOLORS
856 /* These are printf strings, not terminal codes. */ 856 /* These are printf strings, not terminal codes. */
857 {(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")}, 857 {(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")},
858 {(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")}, 858 {(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")},
859 # endif 859 # endif
860 {(int)KS_CBE, IF_EB("\033[?2004h", ESC_STR "[?2004h")},
861 {(int)KS_CBD, IF_EB("\033[?2004l", ESC_STR "[?2004l")},
860 862
861 {K_UP, IF_EB("\033O*A", ESC_STR "O*A")}, 863 {K_UP, IF_EB("\033O*A", ESC_STR "O*A")},
862 {K_DOWN, IF_EB("\033O*B", ESC_STR "O*B")}, 864 {K_DOWN, IF_EB("\033O*B", ESC_STR "O*B")},
863 {K_RIGHT, IF_EB("\033O*C", ESC_STR "O*C")}, 865 {K_RIGHT, IF_EB("\033O*C", ESC_STR "O*C")},
864 {K_LEFT, IF_EB("\033O*D", ESC_STR "O*D")}, 866 {K_LEFT, IF_EB("\033O*D", ESC_STR "O*D")},
900 {K_KEND, IF_EB("\033[4;*~", ESC_STR "[4;*~")}, 902 {K_KEND, IF_EB("\033[4;*~", ESC_STR "[4;*~")},
901 {K_XEND, IF_EB("\033O*F", ESC_STR "O*F")}, /* other End */ 903 {K_XEND, IF_EB("\033O*F", ESC_STR "O*F")}, /* other End */
902 {K_ZEND, IF_EB("\033[8;*~", ESC_STR "[8;*~")}, 904 {K_ZEND, IF_EB("\033[8;*~", ESC_STR "[8;*~")},
903 {K_PAGEUP, IF_EB("\033[5;*~", ESC_STR "[5;*~")}, 905 {K_PAGEUP, IF_EB("\033[5;*~", ESC_STR "[5;*~")},
904 {K_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")}, 906 {K_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")},
905 {K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */ 907 {K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
906 {K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */ 908 {K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */
907 {K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */ 909 {K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */
908 {K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */ 910 {K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */
909 {K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */ 911 {K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */
910 {K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */ 912 {K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
911 {K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */ 913 {K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
914 {K_PS, IF_EB("\033[200~", ESC_STR "[200~")}, /* paste start */
915 {K_PE, IF_EB("\033[201~", ESC_STR "[201~")}, /* paste end */
912 916
913 {BT_EXTRA_KEYS, ""}, 917 {BT_EXTRA_KEYS, ""},
914 {TERMCAP2KEY('k', '0'), IF_EB("\033[10;*~", ESC_STR "[10;*~")}, /* F0 */ 918 {TERMCAP2KEY('k', '0'), IF_EB("\033[10;*~", ESC_STR "[10;*~")}, /* F0 */
915 {TERMCAP2KEY('F', '3'), IF_EB("\033[25;*~", ESC_STR "[25;*~")}, /* F13 */ 919 {TERMCAP2KEY('F', '3'), IF_EB("\033[25;*~", ESC_STR "[25;*~")}, /* F13 */
916 /* F14 and F15 are missing, because they send the same codes as the undo 920 /* F14 and F15 are missing, because they send the same codes as the undo
1222 {K_KMINUS, "[KMINUS]"}, 1226 {K_KMINUS, "[KMINUS]"},
1223 {K_KDIVIDE, "[KDIVIDE]"}, 1227 {K_KDIVIDE, "[KDIVIDE]"},
1224 {K_KMULTIPLY, "[KMULTIPLY]"}, 1228 {K_KMULTIPLY, "[KMULTIPLY]"},
1225 {K_KENTER, "[KENTER]"}, 1229 {K_KENTER, "[KENTER]"},
1226 {K_KPOINT, "[KPOINT]"}, 1230 {K_KPOINT, "[KPOINT]"},
1231 {K_PS, "[PASTE-START]"},
1232 {K_PE, "[PASTE-END]"},
1227 {K_K0, "[K0]"}, 1233 {K_K0, "[K0]"},
1228 {K_K1, "[K1]"}, 1234 {K_K1, "[K1]"},
1229 {K_K2, "[K2]"}, 1235 {K_K2, "[K2]"},
1230 {K_K3, "[K3]"}, 1236 {K_K3, "[K3]"},
1231 {K_K4, "[K4]"}, 1237 {K_K4, "[K4]"},
1536 {KS_TS, "ts"}, {KS_FS, "fs"}, 1542 {KS_TS, "ts"}, {KS_FS, "fs"},
1537 {KS_CWP, "WP"}, {KS_CWS, "WS"}, 1543 {KS_CWP, "WP"}, {KS_CWS, "WS"},
1538 {KS_CSI, "SI"}, {KS_CEI, "EI"}, 1544 {KS_CSI, "SI"}, {KS_CEI, "EI"},
1539 {KS_U7, "u7"}, {KS_RBG, "RB"}, 1545 {KS_U7, "u7"}, {KS_RBG, "RB"},
1540 {KS_8F, "8f"}, {KS_8B, "8b"}, 1546 {KS_8F, "8f"}, {KS_8B, "8b"},
1547 {KS_CBE, "BE"}, {KS_CBD, "BD"},
1548 {KS_CPS, "PS"}, {KS_CPE, "PE"},
1541 {(enum SpecialKey)0, NULL} 1549 {(enum SpecialKey)0, NULL}
1542 }; 1550 };
1543 1551
1544 /* 1552 /*
1545 * If the external termcap does not have a matching entry, try the 1553 * If the external termcap does not have a matching entry, try the
3138 { 3146 {
3139 if (full_screen && !termcap_active) 3147 if (full_screen && !termcap_active)
3140 { 3148 {
3141 out_str(T_TI); /* start termcap mode */ 3149 out_str(T_TI); /* start termcap mode */
3142 out_str(T_KS); /* start "keypad transmit" mode */ 3150 out_str(T_KS); /* start "keypad transmit" mode */
3151 out_str(T_BE); /* enable bracketed paste moe */
3143 out_flush(); 3152 out_flush();
3144 termcap_active = TRUE; 3153 termcap_active = TRUE;
3145 screen_start(); /* don't know where cursor is now */ 3154 screen_start(); /* don't know where cursor is now */
3146 #ifdef FEAT_TERMRESPONSE 3155 #ifdef FEAT_TERMRESPONSE
3147 # ifdef FEAT_GUI 3156 # ifdef FEAT_GUI
3187 /* Check for termcodes first, otherwise an external program may 3196 /* Check for termcodes first, otherwise an external program may
3188 * get them. */ 3197 * get them. */
3189 check_for_codes_from_term(); 3198 check_for_codes_from_term();
3190 } 3199 }
3191 #endif 3200 #endif
3201 out_str(T_BD); /* disable bracketed paste moe */
3192 out_str(T_KE); /* stop "keypad transmit" mode */ 3202 out_str(T_KE); /* stop "keypad transmit" mode */
3193 out_flush(); 3203 out_flush();
3194 termcap_active = FALSE; 3204 termcap_active = FALSE;
3195 cursor_on(); /* just in case it is still off */ 3205 cursor_on(); /* just in case it is still off */
3196 out_str(T_TE); /* stop termcap mode */ 3206 out_str(T_TE); /* stop termcap mode */