Fix generating terminfo on NetBSD

.terminfo.cdb is the compiled terminfo database file.
Ensure that both .terminfo (dir) and .terminfo.cdb are generated.
This commit is contained in:
pagedown 2022-03-16 01:04:26 +08:00
parent f99edbae3c
commit 6638546247
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -88,12 +88,20 @@ mv_files_and_dirs() {
}
compile_terminfo() {
# export TERMINFO
tname=".terminfo"
# Ensure the 78 dir is present
if [ ! -f "$1/$tname/78/xterm-kitty" ]; then
command mkdir -p "$1/$tname/78"
command ln -sf "../x/xterm-kitty" "$1/$tname/78/xterm-kitty"
fi
if [ -e "/usr/share/misc/terminfo.cdb" ]; then
# NetBSD requires this see https://github.com/kovidgoyal/kitty/issues/4622
# NetBSD requires this file, see https://github.com/kovidgoyal/kitty/issues/4622
command ln -sf "../../.terminfo.cdb" "$1/$tname/x/xterm-kitty"
tname=".terminfo.cdb"
fi
# export TERMINFO
export TERMINFO="$HOME/$tname"
# compile terminfo for this system
@ -101,12 +109,6 @@ compile_terminfo() {
tic_out=$(command tic -x -o "$1/$tname" "$1/.terminfo/kitty.terminfo" 2>&1)
[ $? = 0 ] || die "Failed to compile terminfo with err: $tic_out"
fi
# Ensure the 78 dir is present
if [ ! -f "$1/$tname/78/xterm-kitty" ]; then
command mkdir -p "$1/$tname/78"
command ln -sf "../x/xterm-kitty" "$1/$tname/78/xterm-kitty"
fi
}
read_base64_from_tty() {