From cc0907165d388e4e8842d3bda9e24ed4d932d6b8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 27 Nov 2022 11:31:23 +0000 Subject: patch 9.0.0955: libvterm does not support the XTQMODKEYS request Problem: Libvterm does not support the XTQMODKEYS request. Solution: Implement the XTQMODKEYS request and response. Update the keycode check results. --- src/testdir/keycode_check.vim | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/testdir/keycode_check.vim') diff --git a/src/testdir/keycode_check.vim b/src/testdir/keycode_check.vim index ca759ca504..6ad7b773bb 100644 --- a/src/testdir/keycode_check.vim +++ b/src/testdir/keycode_check.vim @@ -134,7 +134,7 @@ def ActionList() endif sort(terms) - var items = ['protocol', 'version', 'status', 'modkeys'] + var items = ['protocol', 'version', 'kitty', 'modkeys'] + key_entries->copy()->map((_, v) => v[1]) # For each terminal compute the needed width, add two. @@ -194,15 +194,17 @@ def DoTerm(name: string) ]) echo "\n" &t_TE = "\[>4;m" - var proto_name = 'none' + var proto_name = 'unknown' if proto == 1 - &t_TI = "" + # Request the XTQMODKEYS value and request the kitty keyboard protocol status. + &t_TI = "\[?4m" .. "\[?u" + proto_name = 'none' elseif proto == 2 - # Enable modifyOtherKeys level 2. Request the XTQMODKEYS value. + # Enable modifyOtherKeys level 2 and request the XTQMODKEYS value. &t_TI = "\[>4;2m" .. "\[?4m" proto_name = 'mok2' elseif proto == 3 - # Enable Kitty keyboard protocol and request the status + # Enable Kitty keyboard protocol and request the status. &t_TI = "\[>1u" .. "\[?u" proto_name = 'kitty' else @@ -262,7 +264,7 @@ def DoTerm(name: string) endif keycodes[name]['protocol'] = proto_name keycodes[name]['version'] = '' - keycodes[name]['status'] = '' + keycodes[name]['kitty'] = '' keycodes[name]['modkeys'] = '' # Check the log file for a status and the version response @@ -277,8 +279,9 @@ def DoTerm(name: string) # Check for the XTQMODKEYS response. if code =~ modkeys_pattern var modkeys = substitute(code, '.*\(' .. modkeys_pattern .. '\).*', '\1', '') - # Get the level out of the response - modkeys = substitute(modkeys, '.*4;\(\d\)m', '\1', '') + # We could get the level out of the response, but showing the response + # itself provides more information. + # modkeys = substitute(modkeys, '.*4;\(\d\)m', '\1', '') if keycodes[name]['modkeys'] != '' echomsg 'Another modkeys found after ' .. keycodes[name]['modkeys'] @@ -292,10 +295,10 @@ def DoTerm(name: string) # use the response itself as the status status = Literal2hex(status) - if keycodes[name]['status'] != '' - echomsg 'Another status found after ' .. keycodes[name]['status'] + if keycodes[name]['kitty'] != '' + echomsg 'Another status found after ' .. keycodes[name]['kitty'] endif - keycodes[name]['status'] = status + keycodes[name]['kitty'] = status endif if code =~ version_pattern -- cgit v1.2.3