1
0
forked from aniani/vim

patch 8.1.2144: side effects when using t_ti to enable modifyOtherKeys

Problem:    Side effects when using t_ti to enable modifyOtherKeys.
Solution:   Add t_TI and t_TE.
This commit is contained in:
Bram Moolenaar
2019-10-12 21:08:59 +02:00
parent 4facea310c
commit 171a921b51
5 changed files with 31 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
*term.txt* For Vim version 8.1. Last change: 2019 May 07 *term.txt* For Vim version 8.1. Last change: 2019 Oct 12
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -80,14 +80,19 @@ can do this best in your .vimrc. Example: >
< <
*raw-terminal-mode* *raw-terminal-mode*
For normal editing the terminal will be put into "raw" mode. The strings For normal editing the terminal will be put into "raw" mode. The strings
defined with 't_ti' and 't_ks' will be sent to the terminal. Normally this defined with 't_ti', 't_TI' and 't_ks' will be sent to the terminal. Normally
puts the terminal in a state where the termcap codes are valid and activates this puts the terminal in a state where the termcap codes are valid and
the cursor and function keys. When Vim exits the terminal will be put back activates the cursor and function keys.
into the mode it was before Vim started. The strings defined with 't_te' and When Vim exits the terminal will be put back into the mode it was before Vim
't_ke' will be sent to the terminal. On the Amiga, with commands that execute started. The strings defined with 't_te', 't_TE' and 't_ke' will be sent to
an external command (e.g., "!!"), the terminal will be put into Normal mode the terminal. On the Amiga, with commands that execute an external command
for a moment. This means that you can stop the output to the screen by (e.g., "!!"), the terminal will be put into Normal mode for a moment. This
hitting a printing key. Output resumes when you hit <BS>. means that you can stop the output to the screen by hitting a printing key.
Output resumes when you hit <BS>.
Note: When 't_ti' is not empty, Vim assumes that it causes switching to the
alternate screen. This may slightly change what happens when executing a
shell command or exiting Vim. To avoid this use 't_TI' and 't_TE'.
*xterm-bracketed-paste* *xterm-bracketed-paste*
When the 't_BE' option is set then 't_BE' will be sent to the When the 't_BE' option is set then 't_BE' will be sent to the
@@ -297,8 +302,8 @@ OUTPUT CODES *terminal-output-codes*
t_se standout end *t_se* *'t_se'* t_se standout end *t_se* *'t_se'*
t_so standout mode *t_so* *'t_so'* t_so standout mode *t_so* *'t_so'*
t_sr scroll reverse (backward) *t_sr* *'t_sr'* t_sr scroll reverse (backward) *t_sr* *'t_sr'*
t_te out of "termcap" mode *t_te* *'t_te'* t_te end of "termcap" mode *t_te* *'t_te'*
t_ti put terminal in "termcap" mode *t_ti* *'t_ti'* t_ti put terminal into "termcap" mode *t_ti* *'t_ti'*
t_ts set window title start (to status line) *t_ts* *'t_ts'* t_ts set window title start (to status line) *t_ts* *'t_ts'*
t_ue underline end *t_ue* *'t_ue'* t_ue underline end *t_ue* *'t_ue'*
t_us underline mode *t_us* *'t_us'* t_us underline mode *t_us* *'t_us'*
@@ -359,6 +364,8 @@ Added by Vim (there are no standard codes for these):
t_RT restore window title from stack *t_RT* *'t_RT'* t_RT restore window title from stack *t_RT* *'t_RT'*
t_Si save icon text to stack *t_Si* *'t_Si'* t_Si save icon text to stack *t_Si* *'t_Si'*
t_Ri restore icon text from stack *t_Ri* *'t_Ri'* t_Ri restore icon text from stack *t_Ri* *'t_Ri'*
t_TE end of "raw" mode *t_TE* *'t_TE'*
t_TI put terminal into "raw" mode *t_TI* *'t_TI'*
Some codes have a start, middle and end part. The start and end are defined Some codes have a start, middle and end part. The start and end are defined
by the termcap option, the middle part is text. by the termcap option, the middle part is text.

View File

@@ -2969,7 +2969,9 @@ static struct vimoption options[] =
p_term("t_ST", T_CST) p_term("t_ST", T_CST)
p_term("t_Te", T_STE) p_term("t_Te", T_STE)
p_term("t_te", T_TE) p_term("t_te", T_TE)
p_term("t_TE", T_CTE)
p_term("t_ti", T_TI) p_term("t_ti", T_TI)
p_term("t_TI", T_CTI)
p_term("t_Ts", T_STS) p_term("t_Ts", T_STS)
p_term("t_ts", T_TS) p_term("t_ts", T_TS)
p_term("t_u7", T_U7) p_term("t_u7", T_U7)

View File

@@ -1624,6 +1624,7 @@ get_term_entries(int *height, int *width)
{KS_CM, "cm"}, {KS_SR, "sr"}, {KS_CM, "cm"}, {KS_SR, "sr"},
{KS_CRI,"RI"}, {KS_VB, "vb"}, {KS_KS, "ks"}, {KS_CRI,"RI"}, {KS_VB, "vb"}, {KS_KS, "ks"},
{KS_KE, "ke"}, {KS_TI, "ti"}, {KS_TE, "te"}, {KS_KE, "ke"}, {KS_TI, "ti"}, {KS_TE, "te"},
{KS_CTI, "TI"}, {KS_CTE, "TE"},
{KS_BC, "bc"}, {KS_CSB,"Sb"}, {KS_CSF,"Sf"}, {KS_BC, "bc"}, {KS_CSB,"Sb"}, {KS_CSF,"Sf"},
{KS_CAB,"AB"}, {KS_CAF,"AF"}, {KS_LE, "le"}, {KS_CAB,"AB"}, {KS_CAF,"AF"}, {KS_LE, "le"},
{KS_ND, "nd"}, {KS_OP, "op"}, {KS_CRV, "RV"}, {KS_ND, "nd"}, {KS_OP, "op"}, {KS_CRV, "RV"},
@@ -3462,6 +3463,7 @@ starttermcap(void)
if (full_screen && !termcap_active) if (full_screen && !termcap_active)
{ {
out_str(T_TI); /* start termcap mode */ out_str(T_TI); /* start termcap mode */
out_str(T_CTI); /* start "raw" mode */
out_str(T_KS); /* start "keypad transmit" mode */ out_str(T_KS); /* start "keypad transmit" mode */
out_str(T_BE); /* enable bracketed paste mode */ out_str(T_BE); /* enable bracketed paste mode */
out_flush(); out_flush();
@@ -3517,6 +3519,7 @@ stoptermcap(void)
out_flush(); out_flush();
termcap_active = FALSE; termcap_active = FALSE;
cursor_on(); /* just in case it is still off */ cursor_on(); /* just in case it is still off */
out_str(T_CTE); /* stop "raw" mode */
out_str(T_TE); /* stop termcap mode */ out_str(T_TE); /* stop termcap mode */
screen_start(); /* don't know where cursor is now */ screen_start(); /* don't know where cursor is now */
out_flush(); out_flush();

View File

@@ -65,7 +65,9 @@ enum SpecialKey
KS_KS, /* put term in "keypad transmit" mode */ KS_KS, /* put term in "keypad transmit" mode */
KS_KE, /* out of "keypad transmit" mode */ KS_KE, /* out of "keypad transmit" mode */
KS_TI, /* put terminal in termcap mode */ KS_TI, /* put terminal in termcap mode */
KS_TE, /* out of termcap mode */ KS_CTI, /* put terminal in "raw" mode */
KS_TE, /* end of termcap mode */
KS_CTE, /* end of "raw" mode */
KS_BC, /* backspace character (cursor left) */ KS_BC, /* backspace character (cursor left) */
KS_CCS, /* cur is relative to scroll region */ KS_CCS, /* cur is relative to scroll region */
KS_CCO, /* number of colors */ KS_CCO, /* number of colors */
@@ -164,7 +166,9 @@ extern char_u *(term_strings[]); /* current terminal strings */
#define T_KS (TERM_STR(KS_KS)) /* put term in "keypad transmit" mode */ #define T_KS (TERM_STR(KS_KS)) /* put term in "keypad transmit" mode */
#define T_KE (TERM_STR(KS_KE)) /* out of "keypad transmit" mode */ #define T_KE (TERM_STR(KS_KE)) /* out of "keypad transmit" mode */
#define T_TI (TERM_STR(KS_TI)) /* put terminal in termcap mode */ #define T_TI (TERM_STR(KS_TI)) /* put terminal in termcap mode */
#define T_TE (TERM_STR(KS_TE)) /* out of termcap mode */ #define T_CTI (TERM_STR(KS_CTI)) /* put terminal in "raw" mode */
#define T_TE (TERM_STR(KS_TE)) /* end of termcap mode */
#define T_CTE (TERM_STR(KS_CTE)) /* end of "raw" mode */
#define T_BC (TERM_STR(KS_BC)) /* backspace character */ #define T_BC (TERM_STR(KS_BC)) /* backspace character */
#define T_CCS (TERM_STR(KS_CCS)) /* cur is relative to scroll region */ #define T_CCS (TERM_STR(KS_CCS)) /* cur is relative to scroll region */
#define T_CCO (TERM_STR(KS_CCO)) /* number of colors */ #define T_CCO (TERM_STR(KS_CCO)) /* number of colors */

View File

@@ -753,6 +753,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2144,
/**/ /**/
2143, 2143,
/**/ /**/