Adding/Fixing Color Within Tmux on Ubuntu
2021-3-25 22:16:36 Author: infinitelogins.com(查看原文) 阅读量:6 收藏

I’ve found that anytime I spin up an Ubuntu system, whether in Digital Ocean, Google Cloud, or even through Windows Subsystem for Linux, color doesn’t seem to be working properly.

To fix this, there is a handy workaround that is very simple to implement.


First, let’s create a bash alias so that launching Tmux will actually launch with color settings configured. Start by editing the following file.

Then add the following line.

alias tmux="TERM=xterm-256color tmux"

Now we will modify our Tmux configuration file as well.

And add the following line.

set -g default-terminal "screen-256color"

Then we will restart Tmux.


Or you could just run these commands.

sudo echo "alias tmux=\"TERM=xterm-256color tmux\"" >> ~/.bash_aliases
sudo echo "set -g default-terminal \"screen-256color\"" >> ~/.tmux.conf
tmux kill-server && tmux

That’s it! Launch Tmux and you should now have color.


文章来源: https://infinitelogins.com/2021/03/25/adding-fixing-color-within-tmux-on-ubuntu/
如有侵权请联系:admin#unsafe.sh