if (typebuf.tb_len >= 4 && (c == CSI || (c == ESC && *p == '[')))
{
idx = (*p == '[');
- if (p[idx] == '2' && p[idx + 1] == '7' && p[idx + 2] == ';')
+ if (p[idx] == '2' && p[idx + 1] == '7' && p[idx + 2] == ';' &&
+ kitty_protocol_state != KKPS_ENABLED)
{
form = 1;
idx += 3;
break;
++idx;
}
+ int kitty_no_mods = argidx == 0 && kitty_protocol_state == KKPS_ENABLED;
if (idx < typebuf.tb_len
&& p[idx] == (form == 1 ? '~' : 'u')
- && argidx == 1)
+ && (argidx == 1 || kitty_no_mods))
{
// Match, consume the code.
typebuf.tb_off += idx + 1;
typebuf_was_filled = FALSE;
#endif
- mod_mask = decode_modifiers(arg[!form]);
+ mod_mask = kitty_no_mods ? 0 : decode_modifiers(arg[!form]);
c = merge_modifyOtherKeys(arg[form], &mod_mask);
}
}
\ kitty: 'y',
\ }, terminalprops())
+ call feedkeys("\<Esc>[?1u") " simulate the kitty keyboard protocol is enabled
+ call feedkeys(':' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIuWithoutModifier("\<Esc>") .. "\<C-B>\"\<CR>", 'Lx!')
+ call assert_equal("\"\<Esc>", @:)
+ call feedkeys(':' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu("\<Esc>", '129') .. "\<C-B>\"\<CR>", 'Lx!')
+ call assert_equal("\"\<Esc>", @:)
+
set t_RV=
call test_override('term_props', 0)
endfunc