Skip to content

Commit

Permalink
Build termcap file
Browse files Browse the repository at this point in the history
  • Loading branch information
Luflosi committed Nov 26, 2019
1 parent 88854c1 commit cfbf62c
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build-terminfo
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ def generate_terminfo():
os.chdir(base)
sys.path.insert(0, base)

from kitty.terminfo import generate_terminfo
from kitty.terminfo import generate_terminfo, generate_termcap

with open('terminfo/kitty.terminfo', 'w') as f:
f.write(generate_terminfo())

with open('terminfo/kitty.termcap', 'w') as f:
f.write(generate_termcap())

compile_terminfo(os.path.join(base, 'terminfo'))


Expand Down
15 changes: 15 additions & 0 deletions kitty/terminfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,21 @@ def generate_terminfo():
return ',\n\t'.join(ans) + ',\n'


def generate_termcap():
inv_termcap_aliases = {v: k for k, v in termcap_aliases.items()}
ans = ['|'.join(names)]
for cap in sorted(bool_capabilities):
if cap not in no_termcap_for:
ans.append(inv_termcap_aliases[cap])
for k in sorted(numeric_capabilities):
if k not in no_termcap_for:
ans.append('{}#{}'.format(inv_termcap_aliases[k], numeric_capabilities[k]))
for k in sorted(string_capabilities):
if k not in no_termcap_for:
ans.append('{}={}'.format(inv_termcap_aliases[k], string_capabilities[k]))
return ':\\\n\t:'.join(ans) + ':\n'


octal_escape = re.compile(r'\\([0-7]{3})')
escape_escape = re.compile(r'\\[eE]')

Expand Down
179 changes: 179 additions & 0 deletions terminfo/kitty.termcap
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
xterm-kitty|KovIdTTY:\
:am:\
:cc:\
:hs:\
:km:\
:5i:\
:mi:\
:ms:\
:NP:\
:xn:\
:Co#256:\
:co#80:\
:it#8:\
:li#24:\
:pa#32767:\
:ac=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
:bl=^G:\
:md=\E[1m:\
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