Skip to content

Commit 8278bac

Browse files
committed
Build termcap file
1 parent 7bf0afa commit 8278bac

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

kitty/terminfo.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,21 @@ def generate_terminfo():
428428
return ',\n\t'.join(ans) + ',\n'
429429

430430

431+
def print_termcap():
432+
inv_termcap_aliases = {v: k for k, v in termcap_aliases.items()}
433+
ans = ['|'.join(names)]
434+
for cap in sorted(bool_capabilities):
435+
if cap not in no_termcap_for:
436+
ans.append(inv_termcap_aliases[cap])
437+
for k in sorted(numeric_capabilities):
438+
if k not in no_termcap_for:
439+
ans.append('{}#{}'.format(inv_termcap_aliases[k], numeric_capabilities[k]))
440+
for k in sorted(string_capabilities):
441+
if k not in no_termcap_for:
442+
ans.append('{}={}'.format(inv_termcap_aliases[k], string_capabilities[k]))
443+
print(':\\\n\t:'.join(ans) + ':\n')
444+
445+
431446
octal_escape = re.compile(r'\\([0-7]{3})')
432447
escape_escape = re.compile(r'\\[eE]')
433448

0 commit comments

Comments
 (0)