Skip to content

Commit

Permalink
Build termcap file
Browse files Browse the repository at this point in the history
  • Loading branch information
Luflosi committed Dec 8, 2019
1 parent 7bf0afa commit 8278bac
Showing 1 changed file with 15 additions and 0 deletions.
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 print_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]))
print(':\\\n\t:'.join(ans) + ':\n')


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

Expand Down

0 comments on commit 8278bac

Please sign in to comment.