fall back to xterm-256color when terminfo is missing

Replace hardcoded kitty TERM hack with a generic check: if the current
TERM's terminfo isn't installed yet, fall back to xterm-256color. The
proper terminfo gets installed later in the script. Fixes tput errors
when SSHing from Ghostty/kitty into fresh machines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Anton Volnuhin 2026-03-03 02:39:31 +03:00
parent 748de2400d
commit 9af745427e

View File

@ -82,9 +82,10 @@ Yello='\033[0;33m' # Blue
Gray='\033[38;5;7m' # Light Gray Gray='\033[38;5;7m' # Light Gray
NC='\033[0m' # No Color NC='\033[0m' # No Color
#short-term hack for kitty in early OSes # Fall back to xterm-256color if the terminal's terminfo isn't installed yet
if [ "$TERM" == "xterm-kitty" ];then # (ghostty/kitty terminfo gets installed later in this script)
export TERM="xterm-256color" if ! infocmp "$TERM" >/dev/null 2>&1; then
export TERM="xterm-256color"
fi fi
cd cd