Add focus reporting capabilities to terminfo

See https://lists.gnu.org/archive/html/bug-ncurses/2023-10/msg00117.html
This commit is contained in:
Kovid Goyal 2023-11-05 15:00:13 +05:30
parent bc1da5525e
commit 9a179a7e90
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 10 additions and 1 deletions

View File

@ -58,6 +58,8 @@ def encode_keystring(keybytes: bytes) -> str:
# described at:
# https://github.com/kovidgoyal/kitty/blob/master/protocol-extensions.asciidoc
'fullkbd',
# Terminal supports focus events: https://lists.gnu.org/archive/html/bug-ncurses/2023-10/msg00117.html
'XF',
# The following are entries that we don't use
# # background color erase
@ -302,6 +304,10 @@ def encode_keystring(keybytes: bytes) -> str:
# Focus In and Out events
'kxIN': r'\E[I',
'kxOUT': r'\E[O',
# Enable/disable focus reporting
# Add to ncurses in: https://lists.gnu.org/archive/html/bug-ncurses/2023-10/msg00117.html
'fe': r'\E[?1004h',
'fd': r'\E[?1004l',
# The following are entries that we don't use
# # turn on blank mode, (characters invisible)
@ -475,7 +481,7 @@ def encode_keystring(keybytes: bytes) -> str:
queryable_capabilities.update(string_capabilities)
extra = (bool_capabilities | numeric_capabilities.keys() | string_capabilities.keys()) - set(termcap_aliases.values())
no_termcap_for = frozenset(
'XR Ms RV kxIN kxOUT Cr Cs Se Ss Setulc Su Smulx Sync Tc PS PE BE BD setrgbf setrgbb fullkbd kUP kDN kbeg kBEG'.split() + [
'XR Ms RV kxIN kxOUT Cr Cs Se Ss Setulc Su Smulx Sync Tc PS PE BE BD setrgbf setrgbb fullkbd kUP kDN kbeg kBEG fe fd XF'.split() + [
f'k{key}{mod}'
for key in 'UP DN RIT LFT BEG END HOM IC DC PRV NXT'.split()
for mod in range(3, 8)])

View File

@ -1,6 +1,7 @@
xterm-kitty|KovIdTTY,
Su,
Tc,
XF,
am,
ccc,
fullkbd,
@ -59,6 +60,8 @@ xterm-kitty|KovIdTTY,
ed=\E[J,
el=\E[K,
el1=\E[1K,
fd=\E[?1004l,
fe=\E[?1004h,
flash=\E[?5h$<100/>\E[?5l,
fsl=^G,
home=\E[H,

BIN
terminfo/x/xterm-kitty generated

Binary file not shown.