Tmux与Oh-my-zsh环境整合

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

猜你喜欢

转载自www.cnblogs.com/Cherry-Linux/p/9053002.html