mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
ssh kitten: Fix location of generated terminfo files on NetBSD
Fixes #4622
This commit is contained in:
@@ -80,6 +80,8 @@ Detailed list of changes
|
|||||||
|
|
||||||
- Fix a regression in the previous release that broke :opt:`active_tab_foreground` (:iss:`4620`)
|
- Fix a regression in the previous release that broke :opt:`active_tab_foreground` (:iss:`4620`)
|
||||||
|
|
||||||
|
- ssh kitten: Fix location of generated terminfo files on NetBSD (:iss:`4622`)
|
||||||
|
|
||||||
0.24.2 [2022-02-03]
|
0.24.2 [2022-02-03]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,16 @@ cat >$tmp << 'TERMEOF'
|
|||||||
TERMINFO
|
TERMINFO
|
||||||
TERMEOF
|
TERMEOF
|
||||||
|
|
||||||
tic_out=$(tic -x -o $HOME/.terminfo $tmp 2>&1)
|
tname=.terminfo
|
||||||
|
if [ -e "/usr/share/misc/terminfo.cdb" ]; then
|
||||||
|
tname=".terminfo.cdb"
|
||||||
|
fi
|
||||||
|
tic_out=$(tic -x -o $HOME/$tname $tmp 2>&1)
|
||||||
rc=$?
|
rc=$?
|
||||||
rm $tmp
|
rm $tmp
|
||||||
if [ "$rc" != "0" ]; then echo "$tic_out"; exit 1; fi
|
if [ "$rc" != "0" ]; then echo "$tic_out"; exit 1; fi
|
||||||
if [ -z "$USER" ]; then export USER=$(whoami); fi
|
if [ -z "$USER" ]; then export USER=$(whoami); fi
|
||||||
export TERMINFO="$HOME/.terminfo"
|
export TERMINFO="$HOME/$tname"
|
||||||
login_shell=""
|
login_shell=""
|
||||||
python=""
|
python=""
|
||||||
|
|
||||||
@@ -109,8 +113,11 @@ import subprocess, os, sys, pwd, binascii, json
|
|||||||
# macOS ships with an ancient version of tic that cannot read from stdin, so we
|
# macOS ships with an ancient version of tic that cannot read from stdin, so we
|
||||||
# create a temp file for it
|
# create a temp file for it
|
||||||
with NamedTemporaryFile() as tmp:
|
with NamedTemporaryFile() as tmp:
|
||||||
|
tname = '.terminfo'
|
||||||
|
if os.path.exists('/usr/share/misc/terminfo.cdb'):
|
||||||
|
tname += '.cdb'
|
||||||
tmp.write(binascii.unhexlify('{terminfo}'))
|
tmp.write(binascii.unhexlify('{terminfo}'))
|
||||||
p = subprocess.Popen(['tic', '-x', '-o', os.path.expanduser('~/.terminfo'), tmp.name], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.Popen(['tic', '-x', '-o', os.path.expanduser('~/' + tname), tmp.name], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
if p.wait() != 0:
|
if p.wait() != 0:
|
||||||
getattr(sys.stderr, 'buffer', sys.stderr).write(stdout + stderr)
|
getattr(sys.stderr, 'buffer', sys.stderr).write(stdout + stderr)
|
||||||
|
|||||||
Reference in New Issue
Block a user