forked from aniani/vim
patch 9.0.0930: cannot debug the Kitty keyboard protocol with TermDebug
Problem: Cannot debug the Kitty keyboard protocol with TermDebug. Solution: Add Kitty keyboard protocol support to the libvterm fork. Recognize the escape sequences that the protocol generates. Add the 'keyprotocol' option to allow the user to specify for which terminal what protocol is to be used, instead of hard-coding this. Add recognizing the kitty keyboard protocol status.
This commit is contained in:
@@ -10,18 +10,19 @@ This subject is introduced in sections |05.4|, |24.7| and |40.1| of the user
|
|||||||
manual.
|
manual.
|
||||||
|
|
||||||
1. Key mapping |key-mapping|
|
1. Key mapping |key-mapping|
|
||||||
1.1 MAP COMMANDS |:map-commands|
|
1.1 MAP COMMANDS |:map-commands|
|
||||||
1.2 Special arguments |:map-arguments|
|
1.2 Special arguments |:map-arguments|
|
||||||
1.3 Mapping and modes |:map-modes|
|
1.3 Mapping and modes |:map-modes|
|
||||||
1.4 Listing mappings |map-listing|
|
1.4 Listing mappings |map-listing|
|
||||||
1.5 Mapping special keys |:map-special-keys|
|
1.5 Mapping special keys |:map-special-keys|
|
||||||
1.6 Special characters |:map-special-chars|
|
1.6 Special characters |:map-special-chars|
|
||||||
1.7 What keys to map |map-which-keys|
|
1.7 What keys to map |map-which-keys|
|
||||||
1.8 Examples |map-examples|
|
1.8 Examples |map-examples|
|
||||||
1.9 Using mappings |map-typing|
|
1.9 Using mappings |map-typing|
|
||||||
1.10 Mapping alt-keys |:map-alt-keys|
|
1.10 Mapping alt-keys |:map-alt-keys|
|
||||||
1.11 Mapping in modifyOtherKeys mode |modifyOtherKeys|
|
1.11 Mapping in modifyOtherKeys mode |modifyOtherKeys|
|
||||||
1.12 Mapping an operator |:map-operator|
|
1.12 Mapping with Kitty keyboard protocol |kitty-keyboard-protocol|
|
||||||
|
1.13 Mapping an operator |:map-operator|
|
||||||
2. Abbreviations |abbreviations|
|
2. Abbreviations |abbreviations|
|
||||||
3. Local mappings and functions |script-local|
|
3. Local mappings and functions |script-local|
|
||||||
4. User-defined commands |user-commands|
|
4. User-defined commands |user-commands|
|
||||||
@@ -1009,7 +1010,34 @@ When the 'esckeys' option is off, then modifyOtherKeys will be disabled in
|
|||||||
Insert mode to avoid every key with a modifier causing Insert mode to end.
|
Insert mode to avoid every key with a modifier causing Insert mode to end.
|
||||||
|
|
||||||
|
|
||||||
1.12 MAPPING AN OPERATOR *:map-operator*
|
1.12 MAPPING WITH KITTY KEYBOARD PROTOCOL *kitty-keyboard-protocol*
|
||||||
|
|
||||||
|
If the value of 'term' contains "kitty" then Vim will send out an escape
|
||||||
|
sequence to enable the Kitty keyboard protocol. This can be changed with the
|
||||||
|
'keyprotocol' option.
|
||||||
|
|
||||||
|
Like modifyOtherKeys, this will make it possible to distinguish between more
|
||||||
|
keys with modifiers. Also, this protocol sends an escape sequence for the Esc
|
||||||
|
key, so that Vim does not need to use a timeout to know whether receiving an
|
||||||
|
Esc character means the Esc key was pressed or it's the start of an escape
|
||||||
|
sequence.
|
||||||
|
|
||||||
|
Vim automatically detects if the Kitty keyboard protocol was enabled when it
|
||||||
|
spots the response to the status request (this should be part of the |t_TI|
|
||||||
|
termcap entry). To see if Vim detected such an escape sequence use: >
|
||||||
|
:verbose map
|
||||||
|
The first line will then show "Kitty keyboard protocol: {value}" (possibly
|
||||||
|
translated). The meaning of {value}:
|
||||||
|
Unknown no status received yet
|
||||||
|
Off protocol is not used
|
||||||
|
On protocol is used
|
||||||
|
Disabled protocol was used but expected to have been disabled
|
||||||
|
by 't_TE'
|
||||||
|
Cleared protocol expected to have beeen disabled by 't_TE',
|
||||||
|
previous state is unknown
|
||||||
|
|
||||||
|
|
||||||
|
1.13 MAPPING AN OPERATOR *:map-operator*
|
||||||
|
|
||||||
An operator is used before a {motion} command. To define your own operator
|
An operator is used before a {motion} command. To define your own operator
|
||||||
you must create a mapping that first sets the 'operatorfunc' option and then
|
you must create a mapping that first sets the 'operatorfunc' option and then
|
||||||
|
@@ -4888,6 +4888,50 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
<PageUp> and <PageDown>.
|
<PageUp> and <PageDown>.
|
||||||
The 'keymodel' option is set by the |:behave| command.
|
The 'keymodel' option is set by the |:behave| command.
|
||||||
|
|
||||||
|
*'keyprotocol'* *'kpc'*
|
||||||
|
'keyprotocol' 'kpc' string (default: see below)
|
||||||
|
global
|
||||||
|
Specifies what keyboard protocol to use depending on the value of
|
||||||
|
'term'. The supported keyboard protocols names are:
|
||||||
|
none whatever the terminal uses
|
||||||
|
mok2 modifyOtherKeys level 2, as supported by xterm
|
||||||
|
kitty Kitty keyboard protocol, as supported by Kitty
|
||||||
|
|
||||||
|
The option value is a list of command separated items. Each item has
|
||||||
|
a pattern that is matched against the 'term' option, a colon and the
|
||||||
|
protocol name to be used. To illustrate this, the default value would
|
||||||
|
be set with: >
|
||||||
|
set keyprotocol=kitty:kitty,foot:kitty,wezterm:kitty,xterm:mok2
|
||||||
|
|
||||||
|
< This means that when 'term' contains "kitty, "foot" or "wezterm"
|
||||||
|
somewhere then the "kitty" protocol is used. When 'term' contains
|
||||||
|
"xterm" somewhere, then the "mok2" protocol is used.
|
||||||
|
|
||||||
|
The first match is used, thus if you want to have "kitty" use the
|
||||||
|
kitty protocol, but "badkitty" not, then you should match "badkitty"
|
||||||
|
first and use the "none" value: >
|
||||||
|
set keyprotocol=badkitty:none,kitty:kitty
|
||||||
|
<
|
||||||
|
The option is used after 'term' has been changed. First the termcap
|
||||||
|
entries are set, possibly using the builtin list, see |builtin-terms|.
|
||||||
|
Then this option is inspected and if there is a match and a protocol
|
||||||
|
is specified the following happens:
|
||||||
|
none Nothing, the regular t_TE and t_TI values remain
|
||||||
|
|
||||||
|
mok2 The t_TE value is changed to:
|
||||||
|
CSI >4;m disables modifyOtherKeys
|
||||||
|
The t_TI value is changed to:
|
||||||
|
CSI >4;2m enables modifyOtherKeys
|
||||||
|
|
||||||
|
kitty The t_TE value is changed to:
|
||||||
|
CSI >4;m disables modifyOtherKeys
|
||||||
|
CSI <u disables the kitty keyboard protocol
|
||||||
|
The t_TI value is changed to:
|
||||||
|
CSI >1u enables the kitty keyboard protocol
|
||||||
|
CSI ?u request kitty keyboard protocol state
|
||||||
|
CSI >c request the termresponse
|
||||||
|
|
||||||
|
|
||||||
*'keywordprg'* *'kp'*
|
*'keywordprg'* *'kp'*
|
||||||
'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help",
|
'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help",
|
||||||
VMS: "help")
|
VMS: "help")
|
||||||
|
@@ -775,6 +775,7 @@ Short explanation of each option: *option-list*
|
|||||||
'key' encryption key
|
'key' encryption key
|
||||||
'keymap' 'kmp' name of a keyboard mapping
|
'keymap' 'kmp' name of a keyboard mapping
|
||||||
'keymodel' 'km' enable starting/stopping selection with keys
|
'keymodel' 'km' enable starting/stopping selection with keys
|
||||||
|
'keyprotocol' 'kpc' what keyboard protocol to use for what terminal
|
||||||
'keywordprg' 'kp' program to use for the "K" command
|
'keywordprg' 'kp' program to use for the "K" command
|
||||||
'langmap' 'lmap' alphabetic characters for other language mode
|
'langmap' 'lmap' alphabetic characters for other language mode
|
||||||
'langmenu' 'lm' language to be used for the menus
|
'langmenu' 'lm' language to be used for the menus
|
||||||
|
@@ -330,7 +330,7 @@ edit(
|
|||||||
|
|
||||||
// Disable modifyOtherKeys, keys with modifiers would cause exiting
|
// Disable modifyOtherKeys, keys with modifiers would cause exiting
|
||||||
// Insert mode.
|
// Insert mode.
|
||||||
out_str(T_CTE);
|
out_str_t_TE();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1377,6 +1377,24 @@ EXTERN int pending_end_reg_executing INIT(= 0);
|
|||||||
// no longer be used.
|
// no longer be used.
|
||||||
EXTERN int seenModifyOtherKeys INIT(= FALSE);
|
EXTERN int seenModifyOtherKeys INIT(= FALSE);
|
||||||
|
|
||||||
|
// The state for the Kitty keyboard protocol.
|
||||||
|
typedef enum {
|
||||||
|
// Initially we have no clue if the protocol is on or off.
|
||||||
|
KKPS_INITIAL,
|
||||||
|
// Used when receiving the state and the flags are zero.
|
||||||
|
KKPS_OFF,
|
||||||
|
// Used when receiving the state and the flags are non-zero.
|
||||||
|
KKPS_ENABLED,
|
||||||
|
// Used after outputting t_KE when the state was KKPS_ENABLED. We do not
|
||||||
|
// really know if t_KE actually disabled the protocol, the following t_KI
|
||||||
|
// is expected to request the state, but the response may come only later.
|
||||||
|
KKPS_DISABLED,
|
||||||
|
// Used after outputting t_KE when the state was not KKPS_ENABLED.
|
||||||
|
KKPS_AFTER_T_KE,
|
||||||
|
} kkpstate_T;
|
||||||
|
|
||||||
|
EXTERN kkpstate_T kitty_protocol_state INIT(= KKPS_INITIAL);
|
||||||
|
|
||||||
EXTERN int no_mapping INIT(= FALSE); // currently no mapping allowed
|
EXTERN int no_mapping INIT(= FALSE); // currently no mapping allowed
|
||||||
EXTERN int no_zero_mapping INIT(= 0); // mapping zero not allowed
|
EXTERN int no_zero_mapping INIT(= 0); // mapping zero not allowed
|
||||||
EXTERN int allow_keys INIT(= FALSE); // allow key codes when no_mapping
|
EXTERN int allow_keys INIT(= FALSE); // allow key codes when no_mapping
|
||||||
|
@@ -368,6 +368,7 @@ size_t vterm_output_get_buffer_remaining(const VTerm *vt);
|
|||||||
size_t vterm_output_read(VTerm *vt, char *buffer, size_t len);
|
size_t vterm_output_read(VTerm *vt, char *buffer, size_t len);
|
||||||
|
|
||||||
int vterm_is_modify_other_keys(VTerm *vt);
|
int vterm_is_modify_other_keys(VTerm *vt);
|
||||||
|
int vterm_is_kitty_keyboard(VTerm *vt);
|
||||||
void vterm_keyboard_unichar(VTerm *vt, uint32_t c, VTermModifier mod);
|
void vterm_keyboard_unichar(VTerm *vt, uint32_t c, VTermModifier mod);
|
||||||
void vterm_keyboard_key(VTerm *vt, VTermKey key, VTermModifier mod);
|
void vterm_keyboard_key(VTerm *vt, VTermKey key, VTermModifier mod);
|
||||||
|
|
||||||
|
@@ -10,6 +10,12 @@ int vterm_is_modify_other_keys(VTerm *vt)
|
|||||||
return vt->state->mode.modify_other_keys;
|
return vt->state->mode.modify_other_keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VIM: added
|
||||||
|
int vterm_is_kitty_keyboard(VTerm *vt)
|
||||||
|
{
|
||||||
|
return vt->state->mode.kitty_keyboard;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void vterm_keyboard_unichar(VTerm *vt, uint32_t c, VTermModifier mod)
|
void vterm_keyboard_unichar(VTerm *vt, uint32_t c, VTermModifier mod)
|
||||||
{
|
{
|
||||||
@@ -19,6 +25,12 @@ void vterm_keyboard_unichar(VTerm *vt, uint32_t c, VTermModifier mod)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VIM: added kitty keyboard protocol support
|
||||||
|
if (vterm_is_kitty_keyboard(vt) && mod != 0) {
|
||||||
|
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "%d;%du", c, mod+1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* The shift modifier is never important for Unicode characters
|
/* The shift modifier is never important for Unicode characters
|
||||||
* apart from Space
|
* apart from Space
|
||||||
*/
|
*/
|
||||||
@@ -166,8 +178,10 @@ void vterm_keyboard_key(VTerm *vt, VTermKey key, VTermModifier mod)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case KEYCODE_TAB:
|
case KEYCODE_TAB:
|
||||||
|
if (vterm_is_kitty_keyboard(vt) && mod != 0)
|
||||||
|
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "9;%du", mod+1);
|
||||||
/* Shift-Tab is CSI Z but plain Tab is 0x09 */
|
/* Shift-Tab is CSI Z but plain Tab is 0x09 */
|
||||||
if(mod == VTERM_MOD_SHIFT)
|
else if(mod == VTERM_MOD_SHIFT)
|
||||||
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "Z");
|
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "Z");
|
||||||
else if(mod & VTERM_MOD_SHIFT)
|
else if(mod & VTERM_MOD_SHIFT)
|
||||||
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "1;%dZ", mod+1);
|
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "1;%dZ", mod+1);
|
||||||
@@ -186,7 +200,10 @@ void vterm_keyboard_key(VTerm *vt, VTermKey key, VTermModifier mod)
|
|||||||
case KEYCODE_LITERAL: case_LITERAL:
|
case KEYCODE_LITERAL: case_LITERAL:
|
||||||
if (vterm_is_modify_other_keys(vt) && mod != 0)
|
if (vterm_is_modify_other_keys(vt) && mod != 0)
|
||||||
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "27;%d;%d~", mod+1, k.literal);
|
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "27;%d;%d~", mod+1, k.literal);
|
||||||
else if(mod & (VTERM_MOD_SHIFT|VTERM_MOD_CTRL))
|
else if (vterm_is_kitty_keyboard(vt) && mod == 0 && k.literal == '\x1b')
|
||||||
|
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "%du", k.literal);
|
||||||
|
else if ((vterm_is_kitty_keyboard(vt) && mod != 0)
|
||||||
|
|| (mod & (VTERM_MOD_SHIFT|VTERM_MOD_CTRL)))
|
||||||
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "%d;%du", k.literal, mod+1);
|
vterm_push_output_sprintf_ctrl(vt, C1_CSI, "%d;%du", k.literal, mod+1);
|
||||||
else
|
else
|
||||||
vterm_push_output_sprintf(vt, mod & VTERM_MOD_ALT ? ESC_S "%c" : "%c", k.literal);
|
vterm_push_output_sprintf(vt, mod & VTERM_MOD_ALT ? ESC_S "%c" : "%c", k.literal);
|
||||||
|
@@ -1423,9 +1423,37 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LEADER('>', 0x6d): // xterm resource modifyOtherKeys
|
case LEADER('>', 0x6d): // CSI > 4 ; Pv m xterm resource modifyOtherKeys
|
||||||
if (argcount == 2 && args[0] == 4)
|
if (argcount == 2 && args[0] == 4)
|
||||||
|
{
|
||||||
|
// can't have both modify_other_keys and kitty_keyboard
|
||||||
|
state->mode.kitty_keyboard = 0;
|
||||||
|
|
||||||
state->mode.modify_other_keys = args[1] == 2;
|
state->mode.modify_other_keys = args[1] == 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LEADER('>', 0x75): // CSI > 1 u enable kitty keyboard protocol
|
||||||
|
if (argcount == 1 && args[0] == 1)
|
||||||
|
{
|
||||||
|
// can't have both modify_other_keys and kitty_keyboard
|
||||||
|
state->mode.modify_other_keys = 0;
|
||||||
|
|
||||||
|
state->mode.kitty_keyboard = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LEADER('<', 0x75): // CSI < u disable kitty keyboard protocol
|
||||||
|
if (argcount <= 1)
|
||||||
|
state->mode.kitty_keyboard = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LEADER('?', 0x75): // CSI ? u request kitty keyboard protocol state
|
||||||
|
if (argcount <= 1)
|
||||||
|
// TODO: this only uses the values zero and one. The protocol specifies
|
||||||
|
// more values, the progressive enhancement flags.
|
||||||
|
vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "?%du",
|
||||||
|
state->mode.kitty_keyboard);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x6e: // DSR - ECMA-48 8.3.35
|
case 0x6e: // DSR - ECMA-48 8.3.35
|
||||||
|
@@ -130,6 +130,7 @@ struct VTermState
|
|||||||
unsigned int bracketpaste:1;
|
unsigned int bracketpaste:1;
|
||||||
unsigned int report_focus:1;
|
unsigned int report_focus:1;
|
||||||
unsigned int modify_other_keys:1;
|
unsigned int modify_other_keys:1;
|
||||||
|
unsigned int kitty_keyboard:1;
|
||||||
} mode;
|
} mode;
|
||||||
|
|
||||||
VTermEncodingInstance encoding[4], encoding_utf8;
|
VTermEncodingInstance encoding[4], encoding_utf8;
|
||||||
|
23
src/map.c
23
src/map.c
@@ -312,8 +312,27 @@ list_mappings(
|
|||||||
// Prevent mappings to be cleared while at the more prompt.
|
// Prevent mappings to be cleared while at the more prompt.
|
||||||
++map_locked;
|
++map_locked;
|
||||||
|
|
||||||
if (p_verbose > 0 && keyround == 1 && seenModifyOtherKeys)
|
if (p_verbose > 0 && keyround == 1)
|
||||||
msg_puts(_("Seen modifyOtherKeys: true"));
|
{
|
||||||
|
if (seenModifyOtherKeys)
|
||||||
|
msg_puts(_("Seen modifyOtherKeys: true"));
|
||||||
|
if (kitty_protocol_state != KKPS_INITIAL)
|
||||||
|
{
|
||||||
|
char *name = _("Unknown");
|
||||||
|
switch (kitty_protocol_state)
|
||||||
|
{
|
||||||
|
case KKPS_INITIAL: break;
|
||||||
|
case KKPS_OFF: name = _("Off"); break;
|
||||||
|
case KKPS_ENABLED: name = _("On"); break;
|
||||||
|
case KKPS_DISABLED: name = _("Disabled"); break;
|
||||||
|
case KKPS_AFTER_T_KE: name = _("Cleared"); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
char buf[200];
|
||||||
|
vim_snprintf(buf, sizeof(buf), _("Kitty keyboard protocol: %s"), name);
|
||||||
|
msg_puts(buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// need to loop over all global hash lists
|
// need to loop over all global hash lists
|
||||||
for (int hash = 0; hash < 256 && !got_int; ++hash)
|
for (int hash = 0; hash < 256 && !got_int; ++hash)
|
||||||
|
@@ -424,7 +424,7 @@ normal_cmd_get_more_chars(
|
|||||||
// Disable bracketed paste and modifyOtherKeys here, we won't
|
// Disable bracketed paste and modifyOtherKeys here, we won't
|
||||||
// recognize the escape sequences with 'esckeys' off.
|
// recognize the escape sequences with 'esckeys' off.
|
||||||
out_str(T_BD);
|
out_str(T_BD);
|
||||||
out_str(T_CTE);
|
out_str_t_TE();
|
||||||
}
|
}
|
||||||
|
|
||||||
*cp = plain_vgetc();
|
*cp = plain_vgetc();
|
||||||
|
@@ -698,6 +698,7 @@ EXTERN char_u *p_keymap; // 'keymap'
|
|||||||
#endif
|
#endif
|
||||||
EXTERN char_u *p_kp; // 'keywordprg'
|
EXTERN char_u *p_kp; // 'keywordprg'
|
||||||
EXTERN char_u *p_km; // 'keymodel'
|
EXTERN char_u *p_km; // 'keymodel'
|
||||||
|
EXTERN char_u *p_kpc; // 'keyprotocol'
|
||||||
#ifdef FEAT_LANGMAP
|
#ifdef FEAT_LANGMAP
|
||||||
EXTERN char_u *p_langmap; // 'langmap'
|
EXTERN char_u *p_langmap; // 'langmap'
|
||||||
EXTERN int p_lnr; // 'langnoremap'
|
EXTERN int p_lnr; // 'langnoremap'
|
||||||
|
@@ -1447,6 +1447,10 @@ static struct vimoption options[] =
|
|||||||
{"keymodel", "km", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
|
{"keymodel", "km", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
|
||||||
(char_u *)&p_km, PV_NONE,
|
(char_u *)&p_km, PV_NONE,
|
||||||
{(char_u *)"", (char_u *)0L} SCTX_INIT},
|
{(char_u *)"", (char_u *)0L} SCTX_INIT},
|
||||||
|
{"keyprotocol", "kpc", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
|
||||||
|
(char_u *)&p_kpc, PV_NONE,
|
||||||
|
{(char_u *)"kitty:kitty,foot:kitty,wezterm:kitty,xterm:mok2", (char_u *)0L}
|
||||||
|
SCTX_INIT},
|
||||||
{"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
{"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||||
(char_u *)&p_kp, PV_KP,
|
(char_u *)&p_kp, PV_KP,
|
||||||
{
|
{
|
||||||
|
@@ -1663,6 +1663,13 @@ did_set_string_option(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 'keyprotocol'
|
||||||
|
else if (varp == &p_kpc)
|
||||||
|
{
|
||||||
|
if (match_keyprotocol(NULL) == KEYPROTOCOL_FAIL)
|
||||||
|
errmsg = e_invalid_argument;
|
||||||
|
}
|
||||||
|
|
||||||
// 'mousemodel'
|
// 'mousemodel'
|
||||||
else if (varp == &p_mousem)
|
else if (varp == &p_mousem)
|
||||||
{
|
{
|
||||||
|
@@ -5348,9 +5348,9 @@ finished:
|
|||||||
long delay_msec = 1;
|
long delay_msec = 1;
|
||||||
|
|
||||||
if (tmode == TMODE_RAW)
|
if (tmode == TMODE_RAW)
|
||||||
// possibly disables modifyOtherKeys, so that the system
|
// Possibly disables modifyOtherKeys, so that the system
|
||||||
// can recognize CTRL-C
|
// can recognize CTRL-C.
|
||||||
out_str(T_CTE);
|
out_str_t_TE();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Similar to the loop above, but only handle X events, no
|
* Similar to the loop above, but only handle X events, no
|
||||||
|
@@ -4,6 +4,7 @@ guicolor_T termgui_mch_get_rgb(guicolor_T color);
|
|||||||
void init_term_props(int all);
|
void init_term_props(int all);
|
||||||
void f_terminalprops(typval_T *argvars, typval_T *rettv);
|
void f_terminalprops(typval_T *argvars, typval_T *rettv);
|
||||||
void set_color_count(int nr);
|
void set_color_count(int nr);
|
||||||
|
keyprot_T match_keyprotocol(char_u *term);
|
||||||
int set_termname(char_u *term);
|
int set_termname(char_u *term);
|
||||||
void free_cur_term(void);
|
void free_cur_term(void);
|
||||||
void getlinecol(long *cp, long *rp);
|
void getlinecol(long *cp, long *rp);
|
||||||
@@ -46,6 +47,7 @@ void win_new_shellsize(void);
|
|||||||
void shell_resized(void);
|
void shell_resized(void);
|
||||||
void shell_resized_check(void);
|
void shell_resized_check(void);
|
||||||
void set_shellsize(int width, int height, int mustset);
|
void set_shellsize(int width, int height, int mustset);
|
||||||
|
void out_str_t_TE(void);
|
||||||
void settmode(tmode_T tmode);
|
void settmode(tmode_T tmode);
|
||||||
void starttermcap(void);
|
void starttermcap(void);
|
||||||
void stoptermcap(void);
|
void stoptermcap(void);
|
||||||
|
162
src/term.c
162
src/term.c
@@ -586,6 +586,32 @@ static tcap_entry_T builtin_xterm[] = {
|
|||||||
{(int)KS_NAME, NULL} // end marker
|
{(int)KS_NAME, NULL} // end marker
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Additions for using modifyOtherKeys level 2. Same as what is used for
|
||||||
|
* xterm.
|
||||||
|
*/
|
||||||
|
static tcap_entry_T builtin_mok2[] = {
|
||||||
|
{(int)KS_CTI, "\033[>4;2m"},
|
||||||
|
{(int)KS_CTE, "\033[>4;m"},
|
||||||
|
|
||||||
|
{(int)KS_NAME, NULL} // end marker
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Additions for using the Kitty keyboard protocol.
|
||||||
|
*/
|
||||||
|
static tcap_entry_T builtin_kitty[] = {
|
||||||
|
// t_TI enables the kitty keyboard protocol, requests the kitty keyboard
|
||||||
|
// protocol state and requests the version response.
|
||||||
|
{(int)KS_CTI, "\033[>1u\033[?u\033[>c"},
|
||||||
|
|
||||||
|
// t_TE also disabled modifyOtherKeys, because t_TI from xterm may already
|
||||||
|
// have been used.
|
||||||
|
{(int)KS_CTE, "\033[>4;m\033[<u"},
|
||||||
|
|
||||||
|
{(int)KS_NAME, NULL} // end marker
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* iris-ansi for Silicon Graphics machines.
|
* iris-ansi for Silicon Graphics machines.
|
||||||
*/
|
*/
|
||||||
@@ -1494,26 +1520,22 @@ find_builtin_term(char_u *term)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parsing of the builtin termcap entries.
|
* Apply entries from a builtin termcap.
|
||||||
* Caller should check if "term" is a valid builtin terminal name.
|
|
||||||
* The terminal's name is not set, as this is already done in termcapinit().
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
parse_builtin_tcap(char_u *term)
|
apply_builtin_tcap(char_u *term, tcap_entry_T *entries, int overwrite)
|
||||||
{
|
{
|
||||||
tcap_entry_T *p = find_builtin_term(term);
|
|
||||||
if (p == NULL) // builtin term not found
|
|
||||||
return;
|
|
||||||
|
|
||||||
int term_8bit = term_is_8bit(term);
|
int term_8bit = term_is_8bit(term);
|
||||||
|
|
||||||
for ( ; p->bt_entry != (int)KS_NAME && p->bt_entry != BT_EXTRA_KEYS; ++p)
|
for (tcap_entry_T *p = entries;
|
||||||
|
p->bt_entry != (int)KS_NAME && p->bt_entry != BT_EXTRA_KEYS; ++p)
|
||||||
{
|
{
|
||||||
if ((int)p->bt_entry >= 0) // KS_xx entry
|
if ((int)p->bt_entry >= 0) // KS_xx entry
|
||||||
{
|
{
|
||||||
// Only set the value if it wasn't set yet.
|
// Only set the value if it wasn't set yet or "overwrite" is TRUE.
|
||||||
if (term_strings[p->bt_entry] == NULL
|
if (term_strings[p->bt_entry] == NULL
|
||||||
|| term_strings[p->bt_entry] == empty_option)
|
|| term_strings[p->bt_entry] == empty_option
|
||||||
|
|| overwrite)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
int opt_idx = -1;
|
int opt_idx = -1;
|
||||||
@@ -1557,12 +1579,25 @@ parse_builtin_tcap(char_u *term)
|
|||||||
char_u name[2];
|
char_u name[2];
|
||||||
name[0] = KEY2TERMCAP0((int)p->bt_entry);
|
name[0] = KEY2TERMCAP0((int)p->bt_entry);
|
||||||
name[1] = KEY2TERMCAP1((int)p->bt_entry);
|
name[1] = KEY2TERMCAP1((int)p->bt_entry);
|
||||||
if (find_termcode(name) == NULL)
|
if (find_termcode(name) == NULL || overwrite)
|
||||||
add_termcode(name, (char_u *)p->bt_string, term_8bit);
|
add_termcode(name, (char_u *)p->bt_string, term_8bit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Parsing of the builtin termcap entries.
|
||||||
|
* Caller should check if "term" is a valid builtin terminal name.
|
||||||
|
* The terminal's name is not set, as this is already done in termcapinit().
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
parse_builtin_tcap(char_u *term)
|
||||||
|
{
|
||||||
|
tcap_entry_T *entries = find_builtin_term(term);
|
||||||
|
if (entries != NULL)
|
||||||
|
apply_builtin_tcap(term, entries, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set number of colors.
|
* Set number of colors.
|
||||||
* Store it as a number in t_colors.
|
* Store it as a number in t_colors.
|
||||||
@@ -1798,6 +1833,67 @@ report_default_term(char_u *term)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Parse the 'keyprotocol' option, match against "term" and return the protocol
|
||||||
|
* for the first matching entry.
|
||||||
|
* When "term" is NULL then compile all patterns to check for any errors.
|
||||||
|
* Returns KEYPROTOCOL_FAIL if a pattern cannot be compiled.
|
||||||
|
* Returns KEYPROTOCOL_NONE if there is no match.
|
||||||
|
*/
|
||||||
|
keyprot_T
|
||||||
|
match_keyprotocol(char_u *term)
|
||||||
|
{
|
||||||
|
int len = (int)STRLEN(p_kpc) + 1;
|
||||||
|
char_u *buf = alloc(len);
|
||||||
|
if (buf == NULL)
|
||||||
|
return KEYPROTOCOL_FAIL;
|
||||||
|
|
||||||
|
keyprot_T ret = KEYPROTOCOL_FAIL;
|
||||||
|
char_u *p = p_kpc;
|
||||||
|
while (*p != NUL)
|
||||||
|
{
|
||||||
|
// Isolate one comma separated item.
|
||||||
|
(void)copy_option_part(&p, buf, len, ",");
|
||||||
|
char_u *colon = vim_strchr(buf, ':');
|
||||||
|
if (colon == NULL || colon == buf || colon[1] == NUL)
|
||||||
|
goto theend;
|
||||||
|
*colon = NUL;
|
||||||
|
|
||||||
|
keyprot_T prot;
|
||||||
|
if (STRCMP(colon + 1, "none") == 0)
|
||||||
|
prot = KEYPROTOCOL_NONE;
|
||||||
|
else if (STRCMP(colon + 1, "mok2") == 0)
|
||||||
|
prot = KEYPROTOCOL_MOK2;
|
||||||
|
else if (STRCMP(colon + 1, "kitty") == 0)
|
||||||
|
prot = KEYPROTOCOL_KITTY;
|
||||||
|
else
|
||||||
|
goto theend;
|
||||||
|
|
||||||
|
regmatch_T regmatch;
|
||||||
|
CLEAR_FIELD(regmatch);
|
||||||
|
regmatch.rm_ic = TRUE;
|
||||||
|
regmatch.regprog = vim_regcomp(buf, RE_MAGIC);
|
||||||
|
if (regmatch.regprog == NULL)
|
||||||
|
goto theend;
|
||||||
|
|
||||||
|
int match = term != NULL && vim_regexec(®match, term, (colnr_T)0);
|
||||||
|
vim_regfree(regmatch.regprog);
|
||||||
|
if (match)
|
||||||
|
{
|
||||||
|
ret = prot;
|
||||||
|
goto theend;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// No match found, use "none".
|
||||||
|
ret = KEYPROTOCOL_NONE;
|
||||||
|
|
||||||
|
theend:
|
||||||
|
vim_free(buf);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set terminal options for terminal "term".
|
* Set terminal options for terminal "term".
|
||||||
* Return OK if terminal 'term' was found in a termcap, FAIL otherwise.
|
* Return OK if terminal 'term' was found in a termcap, FAIL otherwise.
|
||||||
@@ -1924,6 +2020,15 @@ set_termname(char_u *term)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
parse_builtin_tcap(term);
|
parse_builtin_tcap(term);
|
||||||
|
|
||||||
|
// Use the 'keyprotocol' option to adjust the t_TE and t_TI
|
||||||
|
// termcap entries if there is an entry maching "term".
|
||||||
|
keyprot_T kpc = match_keyprotocol(term);
|
||||||
|
if (kpc == KEYPROTOCOL_KITTY)
|
||||||
|
apply_builtin_tcap(term, builtin_kitty, TRUE);
|
||||||
|
else if (kpc == KEYPROTOCOL_MOK2)
|
||||||
|
apply_builtin_tcap(term, builtin_mok2, TRUE);
|
||||||
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
if (term_is_gui(term))
|
if (term_is_gui(term))
|
||||||
{
|
{
|
||||||
@@ -3561,6 +3666,25 @@ set_shellsize(int width, int height, int mustset)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Output T_CTE, the t_TE termcap entry, and handle expected effects.
|
||||||
|
* The code possibly disables modifyOtherKeys and the Kitty keyboard protocol.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
out_str_t_TE(void)
|
||||||
|
{
|
||||||
|
out_str(T_CTE);
|
||||||
|
|
||||||
|
// When the kitty keyboard protocol is enabled we expect t_TE to disable
|
||||||
|
// it. Remembering that it was detected to be enabled is useful in some
|
||||||
|
// situations.
|
||||||
|
if (kitty_protocol_state == KKPS_ENABLED
|
||||||
|
|| kitty_protocol_state == KKPS_DISABLED)
|
||||||
|
kitty_protocol_state = KKPS_DISABLED;
|
||||||
|
else
|
||||||
|
kitty_protocol_state = KKPS_AFTER_T_KE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the terminal to TMODE_RAW (for Normal mode) or TMODE_COOK (for external
|
* Set the terminal to TMODE_RAW (for Normal mode) or TMODE_COOK (for external
|
||||||
* commands and Ex mode).
|
* commands and Ex mode).
|
||||||
@@ -3613,7 +3737,7 @@ settmode(tmode_T tmode)
|
|||||||
if (tmode != TMODE_RAW)
|
if (tmode != TMODE_RAW)
|
||||||
{
|
{
|
||||||
out_str(T_BD); // disable bracketed paste mode
|
out_str(T_BD); // disable bracketed paste mode
|
||||||
out_str(T_CTE); // possibly disables modifyOtherKeys
|
out_str_t_TE(); // possibly disables modifyOtherKeys
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3714,7 +3838,8 @@ 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 "raw" mode, modifyOtherKeys and
|
||||||
|
// Kitty keyboard protocol
|
||||||
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();
|
||||||
@@ -5107,6 +5232,15 @@ handle_csi(
|
|||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kitty keyboard protocol status response: CSI ? flags u
|
||||||
|
else if (first == '?' && argc == 1 && trail == 'u')
|
||||||
|
{
|
||||||
|
// The protocol has various "progressive enhancement flags" values, but
|
||||||
|
// we only check for zero and non-zero here.
|
||||||
|
kitty_protocol_state = arg[0] == '0' ? KKPS_OFF : KKPS_ENABLED;
|
||||||
|
*slen = csi_len;
|
||||||
|
}
|
||||||
|
|
||||||
// Check for a window position response from the terminal:
|
// Check for a window position response from the terminal:
|
||||||
// {lead}3;{x};{y}t
|
// {lead}3;{x};{y}t
|
||||||
else if (did_request_winpos && argc == 3 && arg[0] == 3
|
else if (did_request_winpos && argc == 3 && arg[0] == 3
|
||||||
|
@@ -1587,6 +1587,13 @@ term_convert_key(term_T *term, int c, int modmask, char *buf)
|
|||||||
if (modmask & (MOD_MASK_ALT | MOD_MASK_META))
|
if (modmask & (MOD_MASK_ALT | MOD_MASK_META))
|
||||||
mod |= VTERM_MOD_ALT;
|
mod |= VTERM_MOD_ALT;
|
||||||
|
|
||||||
|
// Ctrl-Shift-i may have the key "I" instead of "i", but for the kitty
|
||||||
|
// keyboard protocol should use "i". Applies to all ascii letters.
|
||||||
|
if (ASCII_ISUPPER(c)
|
||||||
|
&& vterm_is_kitty_keyboard(curbuf->b_term->tl_vterm)
|
||||||
|
&& mod == (VTERM_MOD_CTRL | VTERM_MOD_SHIFT))
|
||||||
|
c = TOLOWER_ASC(c);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert special keys to vterm keys:
|
* Convert special keys to vterm keys:
|
||||||
* - Write keys to vterm: vterm_keyboard_key()
|
* - Write keys to vterm: vterm_keyboard_key()
|
||||||
@@ -2182,6 +2189,19 @@ typedef enum {
|
|||||||
|
|
||||||
static reduce_key_state_T no_reduce_key_state = NRKS_NONE;
|
static reduce_key_state_T no_reduce_key_state = NRKS_NONE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return TRUE if the term is using modifyOtherKeys level 2 or the kitty
|
||||||
|
* keyboard protocol.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
vterm_using_key_protocol(void)
|
||||||
|
{
|
||||||
|
return curbuf->b_term != NULL
|
||||||
|
&& curbuf->b_term->tl_vterm != NULL
|
||||||
|
&& (vterm_is_modify_other_keys(curbuf->b_term->tl_vterm)
|
||||||
|
|| vterm_is_kitty_keyboard(curbuf->b_term->tl_vterm));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
check_no_reduce_keys(void)
|
check_no_reduce_keys(void)
|
||||||
{
|
{
|
||||||
@@ -2191,9 +2211,10 @@ check_no_reduce_keys(void)
|
|||||||
|| curbuf->b_term->tl_vterm == NULL)
|
|| curbuf->b_term->tl_vterm == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (vterm_is_modify_other_keys(curbuf->b_term->tl_vterm))
|
if (vterm_using_key_protocol())
|
||||||
{
|
{
|
||||||
// "modify_other_keys" was enabled while waiting.
|
// "modify_other_keys" or kitty keyboard protocol was enabled while
|
||||||
|
// waiting.
|
||||||
no_reduce_key_state = NRKS_SET;
|
no_reduce_key_state = NRKS_SET;
|
||||||
++no_reduce_keys;
|
++no_reduce_keys;
|
||||||
}
|
}
|
||||||
@@ -2216,8 +2237,7 @@ term_vgetc()
|
|||||||
ctrl_break_was_pressed = FALSE;
|
ctrl_break_was_pressed = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (curbuf->b_term->tl_vterm != NULL
|
if (vterm_using_key_protocol())
|
||||||
&& vterm_is_modify_other_keys(curbuf->b_term->tl_vterm))
|
|
||||||
{
|
{
|
||||||
++no_reduce_keys;
|
++no_reduce_keys;
|
||||||
no_reduce_key_state = NRKS_SET;
|
no_reduce_key_state = NRKS_SET;
|
||||||
@@ -2641,12 +2661,13 @@ raw_c_to_ctrl(int c)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* When modify_other_keys is set then do the reverse of raw_c_to_ctrl().
|
* When modify_other_keys is set then do the reverse of raw_c_to_ctrl().
|
||||||
|
* Also when the Kitty keyboard protocol is used.
|
||||||
* May set "mod_mask".
|
* May set "mod_mask".
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ctrl_to_raw_c(int c)
|
ctrl_to_raw_c(int c)
|
||||||
{
|
{
|
||||||
if (c < 0x20 && vterm_is_modify_other_keys(curbuf->b_term->tl_vterm))
|
if (c < 0x20 && vterm_using_key_protocol())
|
||||||
{
|
{
|
||||||
mod_mask |= MOD_MASK_CTRL;
|
mod_mask |= MOD_MASK_CTRL;
|
||||||
return c + '@';
|
return c + '@';
|
||||||
|
@@ -113,6 +113,8 @@ let test_values = {
|
|||||||
\ 'isprint': [['', '@', '@,48-52'], ['xxx', '@48']],
|
\ 'isprint': [['', '@', '@,48-52'], ['xxx', '@48']],
|
||||||
\ 'keymap': [['', 'accents'], ['xxx']],
|
\ 'keymap': [['', 'accents'], ['xxx']],
|
||||||
\ 'keymodel': [['', 'startsel', 'startsel,stopsel'], ['xxx']],
|
\ 'keymodel': [['', 'startsel', 'startsel,stopsel'], ['xxx']],
|
||||||
|
\ 'keyprotocol': [['', 'xxx:none', 'yyy:mok2', 'zzz:kitty'],
|
||||||
|
\ [':none', 'xxx:', 'x:non', 'y:mok3', 'z:kittty']],
|
||||||
\ 'langmap': [['', 'xX', 'aA,bB'], ['xxx']],
|
\ 'langmap': [['', 'xX', 'aA,bB'], ['xxx']],
|
||||||
\ 'lispoptions': [['', 'expr:0', 'expr:1'], ['xxx']],
|
\ 'lispoptions': [['', 'expr:0', 'expr:1'], ['xxx']],
|
||||||
\ 'listchars': [['', 'eol:x', 'eol:x,space:y'], ['xxx']],
|
\ 'listchars': [['', 'eol:x', 'eol:x,space:y'], ['xxx']],
|
||||||
|
@@ -1 +1 @@
|
|||||||
{"12xterm":{"Space":"20","version":"1b5b3e34313b3335363b3063","C-Tab":"1b5b32373b353b397e","A-Esc":"1b5b32373b333b32377e","C-Space":"1b5b32373b353b33327e","status":"","S-C-I":"1b5b32373b363b37337e","C-I":"1b5b32373b353b3130357e","S-Tab":"1b5b5a","Tab":"09","S-Space":"1b5b32373b323b33327e","A-Tab":"1b5b32373b333b397e","C-Esc":"1b5b32373b353b32377e","protocol":"mok2","A-Space":"1b5b32373b333b33327e","S-Esc":"1b","Esc":"1b"},"libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b32373b353b397e","A-Esc":"1b5b32373b333b32377e","C-Space":"1b5b32373b353b33327e","status":"","S-C-I":"1b5b32373b363b37337e","C-I":"1b5b32373b353b3130357e","S-Tab":"1b5b5a","Tab":"09","resource":"","A-Tab":"1b5b32373b333b397e","S-Space":"1b5b32373b323b33327e","C-Esc":"1b5b32373b353b32377e","protocol":"mok2","A-Space":"1b5b32373b333b33327e","S-Esc":"1b","Esc":"1b"},"2kitty":{"Space":"20","version":"1b5b3e313b343030303b323163","C-Tab":"","A-Esc":"1b5b32373b313175","C-Space":"1b5b33323b3575","status":"1b5b3f3175","S-C-I":"1b5b3130353b3675","C-I":"1b5b3130353b3575","S-Tab":"1b5b393b3275","Tab":"09","S-Space":"20","A-Tab":"1b5b393b313175","C-Esc":"1b5b32373b3575","protocol":"kitty","A-Space":"1b5b33323b313175","S-Esc":"1b5b32373b3275","Esc":"1b5b323775"},"11xterm":{"Space":"20","version":"1b5b3e34313b3335363b3063","C-Tab":"09","A-Esc":"9b00","status":"","S-C-I":"09","C-I":"09","S-Tab":"1b5b5a","Tab":"09","S-Space":"20","A-Tab":"8900","C-Esc":"1b","protocol":"none","A-Space":"a000","S-Esc":"1b","Esc":"1b"}}
|
{"31kitty":{"Space":"20","version":"1b5b3e313b343030303b323163","C-Tab":"","A-Esc":"1b5b32373b313175","C-Space":"1b5b33323b3575","status":"1b5b3f3175","S-C-I":"1b5b3130353b3675","C-I":"1b5b3130353b3575","S-Tab":"1b5b393b3275","Tab":"09","resource":"","A-Tab":"1b5b393b313175","S-Space":"20","C-Esc":"1b5b32373b3575","protocol":"kitty","A-Space":"1b5b33323b313175","S-Esc":"1b5b32373b3275","Esc":"1b5b323775"},"32libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b393b3575","A-Esc":"1b5b32373b3375","C-Space":"1b5b33323b3575","status":"1b5b3f3175","S-C-I":"1b5b3130353b3675","C-I":"1b5b3130353b3575","S-Tab":"1b5b393b3275","Tab":"09","resource":"","A-Tab":"1b5b393b3375","S-Space":"1b5b33323b3275","C-Esc":"1b5b32373b3575","protocol":"kitty","A-Space":"1b5b33323b3375","S-Esc":"1b5b323775","Esc":"1b5b323775"},"22libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b32373b353b397e","A-Esc":"1b5b32373b333b32377e","C-Space":"1b5b32373b353b33327e","status":"","S-C-I":"1b5b32373b363b37337e","C-I":"1b5b32373b353b3130357e","S-Tab":"1b5b5a","Tab":"09","resource":"","A-Tab":"1b5b32373b333b397e","S-Space":"1b5b32373b323b33327e","C-Esc":"1b5b32373b353b32377e","protocol":"mok2","A-Space":"1b5b32373b333b33327e","S-Esc":"1b","Esc":"1b"},"13kitty":{"Space":"20","version":"1b5b3e313b343030303b323163","C-Tab":"","A-Esc":"1b1b","status":"","S-C-I":"1b5b3130353b3675","C-I":"09","S-Tab":"1b5b5a","Tab":"09","resource":"","A-Tab":"1b09","S-Space":"20","C-Esc":"1b","protocol":"none","A-Space":"1b5b33323b313175","S-Esc":"1b","Esc":"1b"},"21xterm":{"Space":"20","version":"1b5b3e34313b3335363b3063","C-Tab":"1b5b32373b353b397e","A-Esc":"1b5b32373b333b32377e","C-Space":"1b5b32373b353b33327e","status":"","S-C-I":"1b5b32373b363b37337e","C-I":"1b5b32373b353b3130357e","S-Tab":"1b5b5a","Tab":"09","resource":"=30","A-Tab":"1b5b32373b333b397e","S-Space":"1b5b32373b323b33327e","C-Esc":"1b5b32373b353b32377e","protocol":"mok2","A-Space":"1b5b32373b333b33327e","S-Esc":"1b","Esc":"1b"},"12libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b393b3575","A-Esc":"9b00","status":"","S-C-I":"1b5b5a","C-I":"09","S-Tab":"1b5b5a","Tab":"09","S-Space":"1b5b33323b3275","A-Tab":"8900","resource":"","C-Esc":"1b5b32373b3575","protocol":"none","A-Space":"a000","S-Esc":"1b","Esc":"1b"},"11xterm":{"Space":"20","version":"1b5b3e34313b3335363b3063","C-Tab":"09","A-Esc":"9b00","status":"","S-C-I":"09","C-I":"09","S-Tab":"1b5b5a","Tab":"09","S-Space":"20","A-Tab":"8900","C-Esc":"1b","protocol":"none","A-Space":"a000","S-Esc":"1b","Esc":"1b"}}
|
||||||
|
@@ -695,6 +695,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 */
|
||||||
|
/**/
|
||||||
|
930,
|
||||||
/**/
|
/**/
|
||||||
929,
|
929,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -2257,6 +2257,14 @@ typedef enum {
|
|||||||
ESTACK_SCRIPT,
|
ESTACK_SCRIPT,
|
||||||
} estack_arg_T;
|
} estack_arg_T;
|
||||||
|
|
||||||
|
// Return value of match_keyprotocol()
|
||||||
|
typedef enum {
|
||||||
|
KEYPROTOCOL_NONE,
|
||||||
|
KEYPROTOCOL_MOK2,
|
||||||
|
KEYPROTOCOL_KITTY,
|
||||||
|
KEYPROTOCOL_FAIL
|
||||||
|
} keyprot_T;
|
||||||
|
|
||||||
// Flags for assignment functions.
|
// Flags for assignment functions.
|
||||||
#define ASSIGN_VAR 0 // ":var" (nothing special)
|
#define ASSIGN_VAR 0 // ":var" (nothing special)
|
||||||
#define ASSIGN_FINAL 0x01 // ":final"
|
#define ASSIGN_FINAL 0x01 // ":final"
|
||||||
|
Reference in New Issue
Block a user