在Mac客户端配置好oh-my-zsh后,安装了tmux应用,但是每次进入tmux都会提示以下警告信息,虽然并没有实际上的影响,但是还是感觉每次弹出窗口后会很闹心,所以采用如下配置进行解决。
报错如下:
WARNING! Your terminal appears to support less than 256 colors!
If your terminal supports 256 colors, please export the appropriate environment variable
_before_ loading this theme in your ~/.zshrc. In most terminal emulators, putting
export TERM="xterm-256color" at the top of your ~/.zshrc is sufficient.
解决办法如下:
- 修改
.zshrc
配置文件,添加下列配置。
[[ $TMUX = "" ]] && export TERM="xterm-256color"
- 修改
.tmux.conf
配置文件,添加下列配置(如果此文件不存在,直接创建即可。)
set -g default-terminal "screen-256color"