user_4813494d@ai-dfb9442f55:~# tmux new -s cc missing or unsuitable terminal:…
- User
user_4813494d@ai-dfb9442f55:~# tmux new -s cc missing or unsuitable terminal: xterm-ghostty
Assistant
tmux doesn't recognize
xterm-ghostty. Override the TERM for the command:codetmux -T xterm-256color new -s ccor set it inline:
codeTERM=xterm-256color tmux new -s ccFor a permanent fix, add to
~/.bashrc:code[ "$TERM" = "xterm-ghostty" ] && export TERM=xterm-256colorBetter long-term: install Ghostty's terminfo on the remote host so
xterm-ghosttyis recognized:codeinfocmp -x xterm-ghostty | ssh <host> -- tic -x -(run from your local machine where Ghostty is installed).
- User
说中文 修复这个问题
Assistant
我先立刻修好当前会话,再写入
~/.bashrc持久化。Assistant
搞定。现在你可以直接运行:
codeTERM=xterm-256color tmux new -s cc或者重新登录 / 执行
source ~/.bashrc后,直接tmux new -s cc就能正常启动。更彻底的方案(可选):在本地 Ghostty 所在机器执行,把 terminfo 传到远程:
codeinfocmp -x xterm-ghostty | ssh <远程主机> -- tic -x -装
- User
[Request interrupted by user]
Assistant
No response requested.
- User
Resume this session with: claude --resume 02e97c42-2514-496e-ba6e-aeeb86cc245a ^Croot@ai-dfb9442f55:
# ^C user_4813494d@ai-dfb9442f55:# ^C user_4813494d@ai-dfb9442f55:~# tmux new -s cc missing or unsuitable terminal: xterm-ghostty 还是这样 我就希望tmux就能完全正常用 Assistant
彻底的办法是在系统里装上
xterm-ghostty的 terminfo,这样任何程序(tmux、vim、less 等)都认它。我用xterm-256color作为基础,复制成xterm-ghostty条目并编译安装。Assistant
修好了。现在直接运行
tmux new -s cc就能用,无需TERM=xxx前缀。做了什么:
- 用
xterm-256color的条目复制一份命名为xterm-ghostty,tic -x编译后装到/etc/terminfo/x/xterm-ghostty - 回滚了之前在
~/.bashrc里加的临时兜底(不再需要)
注意:这是个"别名"方案(共用 256color 的能力),Ghostty 的一些扩展特性(如更好的颜色/kitty 键盘协议)用不上。如果以后需要原生 Ghostty terminfo,可以在本地装 Ghostty 的机器上跑:
codeinfocmp -x xterm-ghostty | ssh <远程> -- tic -x -会把原生条目覆盖掉现在这份。
- 用
- User
● 彻底的办法是在系统里装上 xterm-ghostty 的 terminfo,这样任何程序(tmux、vim、less 等)都认它。我用 xterm-256color 作为基础,复制成 xterm-ghostty 条目并编译安装。 你完成安装了 你到底做了什么 最好的方法是什么
Assistant
我做了什么
- 生成 terminfo 源文件:用
infocmp xterm-256color导出系统里已有的xterm-256color能力描述,把开头的名字改成xterm-ghostty,保存为/tmp/xterm-ghostty.ti。 - 编译并安装:
tic -x /tmp/xterm-ghostty.ti,产物写到/etc/terminfo/x/xterm-ghostty。从此 tmux/vim/less/ssh 等任何查 terminfo 的程序都认xterm-ghostty这个名字。 - 清理:删掉了之前加在
~/.bashrc里的TERM兜底(已不需要)。
本质:给 Ghostty 这个名字注册了一个"别名条目",能力等同于
xterm-256color。这是不是最好的方法?
不是。这是能立刻修好、但能力打折的方案。
最好的方法是用 Ghostty 官方的 terminfo,因为它声明了一些
xterm-256color没有的扩展能力(比如Setulc/Smulx彩色下划线、Kitty 键盘协议、更丰富的真彩色/图形协议等)。程序能感知到这些能力才会启用对应特性。推荐做法(任选其一)
方案 A:从本地 Ghostty 推到远程(最干净)
在你本地装了 Ghostty 的机器上跑一次:
codeinfocmp -x xterm-ghostty | ssh user_4813494d@<远程主机> -- tic -x -- 生成 terminfo 源文件:用