Skip to content

fix: fall back TERM when terminfo is missing#28

Merged
alohays merged 1 commit into
mainfrom
fix/terminfo-fallback
Mar 23, 2026
Merged

fix: fall back TERM when terminfo is missing#28
alohays merged 1 commit into
mainfrom
fix/terminfo-fallback

Conversation

@alohays
Copy link
Copy Markdown
Owner

@alohays alohays commented Mar 23, 2026

Summary

  • env.sh: generic TERM fallback via infocmp check — when the advertised terminal lacks a local terminfo entry (e.g. xterm-ghostty over SSH), automatically fall back to xterm-256color so tmux and other ncurses tools can start
  • Ghostty config: enable ssh-terminfo and ssh-env shell integration features so Ghostty v1.2.0+ auto-installs its terminfo on remote hosts, with automatic xterm-256color fallback when blocked

Two-layer approach

Layer Where What
Ghostty config Client (local machine) Auto-install terminfo on SSH targets; fall back if blocked
env.sh fallback Server (remote host) Catch-all for any terminal with missing terminfo

Why both?

  • Layer 1 (Ghostty) handles the common case and preserves full Ghostty features
  • Layer 2 (env.sh) catches edge cases: non-Ghostty terminals, restricted SSH environments (AWS EC2, etc.), hosts where shell integration is blocked
  • Complements PR fix: add terminfo capability guard to interactive.d scripts #27's dotfiles_term_capable() which guards ZLE plugins but doesn't fix TERM itself

Test plan

  • source ~/.zshenv && echo $TERMxterm-256color on host without ghostty terminfo
  • tmux ls → no "missing or unsuitable terminal" error
  • On Ghostty with shell integration: reconnect → terminfo auto-installed → TERM=xterm-ghostty preserved

🤖 Generated with Claude Code

Two-layer fix for "missing or unsuitable terminal: xterm-ghostty":

1. env.sh: generic TERM fallback via infocmp check — when the
   advertised terminal lacks a local terminfo entry, fall back to
   xterm-256color so tmux and other ncurses tools can start.

2. Ghostty config: enable ssh-terminfo and ssh-env shell integration
   features so Ghostty auto-installs its terminfo on remote hosts
   (v1.2.0+), with automatic xterm-256color fallback when blocked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alohays alohays merged commit d7af237 into main Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant