mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-11 14:45:31 +03:00
Add non-standard terminfo capabilities
Advertises support for truecolor and styled underlines. The truecolor properties are used by at least tmux and neovim.
This commit is contained in:
parent
77d46630d7
commit
2ab6f57159
@ -15,7 +15,7 @@ with open('terminfo/kitty.terminfo', 'w') as f:
|
|||||||
f.write(generate_terminfo())
|
f.write(generate_terminfo())
|
||||||
|
|
||||||
os.environ['TERMINFO'] = os.path.join(base, 'terminfo')
|
os.environ['TERMINFO'] = os.path.join(base, 'terminfo')
|
||||||
subprocess.check_call(['tic', 'terminfo/kitty.terminfo'])
|
subprocess.check_call(['tic', '-x', 'terminfo/kitty.terminfo'])
|
||||||
# On OS X tic puts the compiled database into a different directory
|
# On OS X tic puts the compiled database into a different directory
|
||||||
try:
|
try:
|
||||||
os.mkdir('terminfo/78')
|
os.mkdir('terminfo/78')
|
||||||
|
@ -38,8 +38,14 @@ def safe_print(*a, **k):
|
|||||||
'xenl',
|
'xenl',
|
||||||
# has extra status line (window title)
|
# has extra status line (window title)
|
||||||
'hs',
|
'hs',
|
||||||
|
# Terminfo extension used by tmux to detect true color support (non-standard)
|
||||||
|
'Tc',
|
||||||
|
# Indicates support for styled and colored underlines (non-standard) as
|
||||||
|
# described at:
|
||||||
|
# https://github.com/kovidgoyal/kitty/blob/master/protocol-extensions.asciidoc
|
||||||
|
'Su',
|
||||||
|
|
||||||
# The following are entries from termite's terminfo that we dont need
|
# The following are entries that we dont use
|
||||||
# # background color erase
|
# # background color erase
|
||||||
# 'bce',
|
# 'bce',
|
||||||
}
|
}
|
||||||
@ -266,8 +272,12 @@ def safe_print(*a, **k):
|
|||||||
'ka3': r'',
|
'ka3': r'',
|
||||||
'kc1': r'',
|
'kc1': r'',
|
||||||
'kc3': r'',
|
'kc3': r'',
|
||||||
|
# Set RGB foreground color (non-standard used by neovim)
|
||||||
|
'setrgbf': r'\E[38:2:%p1%d:%p2%d:%p3%dm',
|
||||||
|
# Set RGB background color (non-standard used by neovim)
|
||||||
|
'setrgbb': r'\E[48:2:%p1%d:%p2%d:%p3%dm',
|
||||||
|
|
||||||
# The following are entries from termite's terminfo that we dont need
|
# The following are entries that we dont use
|
||||||
# # display status line
|
# # display status line
|
||||||
# 'dsl': r'\E]2;\007',
|
# 'dsl': r'\E]2;\007',
|
||||||
# # return from status line
|
# # return from status line
|
||||||
@ -407,7 +417,8 @@ def safe_print(*a, **k):
|
|||||||
queryable_capabilities = numeric_capabilities.copy()
|
queryable_capabilities = numeric_capabilities.copy()
|
||||||
queryable_capabilities.update(string_capabilities)
|
queryable_capabilities.update(string_capabilities)
|
||||||
extra = (bool_capabilities | numeric_capabilities.keys() | string_capabilities.keys()) - set(termcap_aliases.values())
|
extra = (bool_capabilities | numeric_capabilities.keys() | string_capabilities.keys()) - set(termcap_aliases.values())
|
||||||
if extra:
|
no_termcap_for = frozenset('Su Tc setrgbf setrgbb'.split())
|
||||||
|
if extra - no_termcap_for:
|
||||||
raise Exception('Termcap aliases not complete, missing: {}'.format(extra))
|
raise Exception('Termcap aliases not complete, missing: {}'.format(extra))
|
||||||
del extra
|
del extra
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1,4 +1,6 @@
|
|||||||
xterm-kitty|KovIdTTY,
|
xterm-kitty|KovIdTTY,
|
||||||
|
Su,
|
||||||
|
Tc,
|
||||||
am,
|
am,
|
||||||
ccc,
|
ccc,
|
||||||
hs,
|
hs,
|
||||||
@ -109,6 +111,8 @@ xterm-kitty|KovIdTTY,
|
|||||||
sc=\E7,
|
sc=\E7,
|
||||||
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
|
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
|
||||||
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
|
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
|
||||||
|
setrgbb=\E[48:2:%p1%d:%p2%d:%p3%dm,
|
||||||
|
setrgbf=\E[38:2:%p1%d:%p2%d:%p3%dm,
|
||||||
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
|
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
|
||||||
sgr0=\E(B\E[m,
|
sgr0=\E(B\E[m,
|
||||||
sitm=\E[3m,
|
sitm=\E[3m,
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user