summaryrefslogtreecommitdiffstats
path: root/src/testdir/keycode_check.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-26 19:16:48 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-26 19:16:48 +0000
commitc255b789653120979eacdf8bb8eca02487753a8e (patch)
tree50a07d7bcbac6a0331c47ed4da72f137cdb5b2e5 /src/testdir/keycode_check.vim
parent837ca8f43b9d6b8574a2bfdae219b17c84411730 (diff)
patch 9.0.0954: cannot detect whether modifyOtherKeys is enabledv9.0.0954
Problem: Cannot detect whether modifyOtherKeys is enabled. Solution: Use XTQMODKEYS introduced by xterm version 377 to request the modifyOtherKeys level. Update the keycode check results.
Diffstat (limited to 'src/testdir/keycode_check.vim')
-rw-r--r--src/testdir/keycode_check.vim33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/testdir/keycode_check.vim b/src/testdir/keycode_check.vim
index d754490a3e..ca759ca504 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', 'resource']
+ var items = ['protocol', 'version', 'status', 'modkeys']
+ key_entries->copy()->map((_, v) => v[1])
# For each terminal compute the needed width, add two.
@@ -198,9 +198,8 @@ def DoTerm(name: string)
if proto == 1
&t_TI = ""
elseif proto == 2
- # Enable modifyOtherKeys level 2
- # Request the resource value: DCS + Q modifyOtherKeys ST
- &t_TI = "\<Esc>[>4;2m" .. "\<Esc>P+Q6d6f646966794f746865724b657973\<Esc>\\"
+ # Enable modifyOtherKeys level 2. Request the XTQMODKEYS value.
+ &t_TI = "\<Esc>[>4;2m" .. "\<Esc>[?4m"
proto_name = 'mok2'
elseif proto == 3
# Enable Kitty keyboard protocol and request the status
@@ -218,10 +217,10 @@ def DoTerm(name: string)
# Pattern that matches the line with the version response.
const version_pattern = "\<Esc>\\[>\\d\\+;\\d\\+;\\d*c"
- # Pattern that matches the resource value response:
- # DCS 1 + R Pt ST valid
- # DCS 0 + R Pt ST invalid
- const resource_pattern = "\<Esc>P[01]+R.*\<Esc>\\\\"
+ # Pattern that matches the XTQMODKEYS response:
+ # CSI > 4;Pv m
+ # where Pv indicates the modifyOtherKeys level
+ const modkeys_pattern = "\<Esc>\\[>4;\\dm"
# Pattern that matches the line with the status. Currently what terminals
# return for the Kitty keyboard protocol.
@@ -264,7 +263,7 @@ def DoTerm(name: string)
keycodes[name]['protocol'] = proto_name
keycodes[name]['version'] = ''
keycodes[name]['status'] = ''
- keycodes[name]['resource'] = ''
+ keycodes[name]['modkeys'] = ''
# Check the log file for a status and the version response
ch_logfile('', '')
@@ -275,16 +274,16 @@ def DoTerm(name: string)
if line =~ 'raw key input'
var code = substitute(line, '.*raw key input: "\([^"]*\).*', '\1', '')
- # Check for resource value response
- if code =~ resource_pattern
- var resource = substitute(code, '.*\(' .. resource_pattern .. '\).*', '\1', '')
- # use the value as the resource, "=30" means zero
- resource = substitute(resource, '.*\(=\p\+\).*', '\1', '')
+ # 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', '')
- if keycodes[name]['resource'] != ''
- echomsg 'Another resource found after ' .. keycodes[name]['resource']
+ if keycodes[name]['modkeys'] != ''
+ echomsg 'Another modkeys found after ' .. keycodes[name]['modkeys']
endif
- keycodes[name]['resource'] = resource
+ keycodes[name]['modkeys'] = modkeys
endif
# Check for kitty keyboard protocol status