ghostty-terminfo
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGhostty Terminfo Installation
Ghostty Terminfo 安装指南
Overview
概述
Ghostty uses as its value. Remote hosts that lack this terminfo entry will show broken terminal behavior. The fix is to transfer the terminfo from the local machine to the remote host.
xterm-ghostty$TERMGhostty 使用作为其值。缺少该terminfo条目的远程主机会出现终端行为异常。解决方法是将本地机器的terminfo传输到远程主机。
xterm-ghostty$TERMWhen to Use
适用场景
- Remote SSH sessions show "unknown terminal type xterm-ghostty"
- Missing colors, broken backspace/arrow keys, or garbled output over SSH
- Setting up a new remote host for use with Ghostty
- Writing SSH scripts that should handle Ghostty terminfo automatically
- 远程SSH会话显示“unknown terminal type xterm-ghostty”
- SSH连接时出现颜色缺失、退格/方向键失效或输出乱码
- 为使用Ghostty配置新的远程主机
- 编写可自动处理Ghostty terminfo的SSH脚本
Quick Reference
快速参考
| Task | Command |
|---|---|
| Check if remote has terminfo | |
| Install terminfo on remote | |
| One-liner check + install | |
| Verify after install | |
| 任务 | 命令 |
|---|---|
| 检查远程主机是否有terminfo | |
| 在远程主机安装terminfo | |
| 检查+安装一键命令 | |
| 安装后验证 | |
Implementation
实施步骤
Local Install
本地安装
If you're already on the machine, just pipe it directly to :
ticbash
infocmp -x xterm-ghostty | tic -x -如果已经在目标机器上,直接通过管道传输给:
ticbash
infocmp -x xterm-ghostty | tic -x -One-Time Install
一次性安装
bash
infocmp -x xterm-ghostty | ssh user@host tic -x -This exports the local terminfo and compiles it on the remote host. Only needs to run once per remote machine.
bash
infocmp -x xterm-ghostty | ssh user@host tic -x -这会导出本地的terminfo并在远程主机上编译。每台远程主机只需运行一次。
Conditional Install in SSH Scripts
SSH脚本中的条件安装
bash
if [ "$TERM" = "xterm-ghostty" ]; then
ssh "$HOST" 'infocmp xterm-ghostty >/dev/null 2>&1' || \
infocmp -x xterm-ghostty | ssh "$HOST" tic -x -
fiOnly runs when connecting from Ghostty, skips if already installed.
bash
if [ "$TERM" = "xterm-ghostty" ]; then
ssh "$HOST" 'infocmp xterm-ghostty >/dev/null 2>&1' || \
infocmp -x xterm-ghostty | ssh "$HOST" tic -x -
fi仅当从Ghostty连接时运行,如果已安装则跳过。
Common Mistakes
常见错误
- Running from non-Ghostty terminal - fails if the local machine doesn't have the terminfo. Run from Ghostty or a machine with Ghostty installed.
infocmp xterm-ghostty - Forgetting flag - Both
-xandinfocmp -xneed the extended flag to preserve Ghostty's extended capabilities.tic -x - Workaround instead of fix - Setting before SSH works but loses Ghostty-specific features. Install the terminfo instead.
TERM=xterm-256color
- 从非Ghostty终端运行 - 如果本地机器没有该terminfo,会失败。请从Ghostty或已安装Ghostty的机器运行。
infocmp xterm-ghostty - 忘记标志 -
-x和infocmp -x都需要使用扩展标志来保留Ghostty的扩展功能。tic -x - 使用替代方案而非修复 - SSH前设置可以生效,但会丢失Ghostty的特定功能。建议安装terminfo。
TERM=xterm-256color