最近用conda install tmux后,使用命令watch -n 0.1 -d nvidia-smi
无法正常实时查看,显示error open terminal:tmux 256-color错误。
之前查了很久没找到解决方案,今天在tmux界面里用vim也同样报了如下错:
E558: Terminal entry not found in terminfo
'screen-256color' not known
又是256-color的问题!遂搜了相关的解决办法:
1、vim编辑如下文件:
vim ~/.tmux.conf
在文件中添加一行:
set -g default-terminal "screen-256color"
保存后,退出tmux,重启,再用watch nvidia命令和vim即可正常使用
参考资料:
Getting 256 colors to work in tmux - Unix & Linux Stack Exchange