A full-stack developer.
换用 Ghostty 后本机正常,一旦以 root 运行命令就会报 xterm-ghostty: unknown terminal type。原因是 sudo 默认重置环境变量,丢掉了 Ghostty 的 TERMINFO,root 下查不到这条 terminfo 记录,vim、tmux 便不知道如何驱动终端。官方 discussion 的做法是把 terminfo 复制到服务器,这里只需拷给 root:先用 infocmp -x 导出,再 sudo tic -x 安装。