diff --git a/build-terminfo b/build-terminfo index 25bbc50bc..a4dc04344 100755 --- a/build-terminfo +++ b/build-terminfo @@ -4,7 +4,6 @@ import glob import os -import re import shutil import subprocess import sys @@ -13,11 +12,10 @@ import tempfile def compile_terminfo(base): with tempfile.TemporaryDirectory() as tdir: - proc = subprocess.run(['tic', '-x', f'-o{tdir}', 'terminfo/kitty.terminfo'], check=True, stderr=subprocess.PIPE) - regex = '^"terminfo/kitty.terminfo", line [0-9]+, col [0-9]+, terminal \'xterm-kitty\': older tic versions may treat the description field as an alias$' - for error in proc.stderr.decode('utf-8').splitlines(): - if not re.match(regex, error): - print(error, file=sys.stderr) + proc = subprocess.run(['tic', '-x', f'-o{tdir}', 'terminfo/kitty.terminfo'], capture_output=True) + if proc.returncode != 0: + sys.stderr.buffer.write(proc.stderr) + raise SystemExit(proc.returncode) tfiles = glob.glob(os.path.join(tdir, '*', 'xterm-kitty')) if not tfiles: raise SystemExit('tic failed to output the compiled kitty terminfo file') @@ -29,6 +27,13 @@ def compile_terminfo(base): os.makedirs(odir, exist_ok=True) ofile = os.path.join(odir, xterm_kitty) shutil.move(tfile, ofile) + proc = subprocess.run(['tic', '-CrT0', 'terminfo/kitty.terminfo'], capture_output=True) + if proc.returncode != 0: + sys.stderr.buffer.write(proc.stderr) + raise SystemExit(proc.returncode) + tcap = proc.stdout.decode('utf-8').splitlines()[-1] + with open('terminfo/kitty.termcap', 'w') as f: + f.write(tcap) def generate_terminfo(): diff --git a/docs/faq.rst b/docs/faq.rst index 6dcab763b..645db4498 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -72,7 +72,7 @@ If the server is running FreeBSD, or another system that relies on termcap rather than terminfo, you will need to convert the terminfo file on your local machine by running (on local machine with |kitty|):: - infocmp -C xterm-kitty + infocmp -CrT0 xterm-kitty The output of this command is the termcap description, which should be appended to :file:`/usr/share/misc/termcap` on the remote server. Then run the following diff --git a/terminfo/kitty.termcap b/terminfo/kitty.termcap new file mode 100644 index 000000000..37c6794c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