在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"