mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
Ensure the extended keyboard protocol key encoding is stable
Also use base85 instead of base64 for keyname encoding to reduce average length
This commit is contained in:
@@ -37,7 +37,7 @@ if raw != nraw:
|
||||
|
||||
raw = subprocess.check_output([
|
||||
'kitty', '-c',
|
||||
'from kitty.keys import *; import json; print(json.dumps(generate_key_extended_map(True)))'
|
||||
'from kitty.key_encoding import *; import json; print(json.dumps(ENCODING))'
|
||||
]).decode('utf-8')
|
||||
key_map = json.loads(raw)
|
||||
lines = [
|
||||
@@ -45,7 +45,7 @@ lines = [
|
||||
'', '|===', '| Name | Encoded representation (base64)', ''
|
||||
]
|
||||
for k in sorted(key_map):
|
||||
lines.append('| {:15s} | `{}`'.format(k.replace('_', ' '), key_map[k]))
|
||||
lines.append('| {:15s} | `{}`'.format(k.replace('_', ' '), key_map[k].replace('`', '\\`')))
|
||||
lines += ['', '|===']
|
||||
with open('key_encoding.asciidoc', 'w') as f:
|
||||
print('= Key encoding for extended keyboard protocol\n', file=f)
|
||||
|
||||
Reference in New Issue
Block a user