7

I use the fish shell. I'm trying to run vim inside tmux with the solarized theme, but the colors are broken unless I run:

set -lx TERM screen-256color-bce;

before running tmux attach.

It's annoying having to run this every day, so I want to set the TERM variable permanently. However, fish seems to ignore when I set this particular variable with set -U:

$ set -U foo bar; echo $foo
foo bar
$ set -U TERM screen-256color-bce; echo $TERM
TERM xterm
$ set -lx TERM screen-256color-bce; echo $TERM
TERM screen-256color-bce

I even tried putting set -lx TERM screen-256color-bce in ~/.config/fish/config.fish, but a new fish (initiated outside tmux) always has TERM set to xterm.

sjy
  • 209

3 Answers3

3
set -gx TERM screen-256color-bce;

I had the exact same problem as you. replace the "l" with "g" as g means global.

Brian Yeh
  • 131
2

You can set it from the terminal using

set -Ux TERM screen-256color-bce

You don't need to put it in your config file this way.

  • -U if for Universal
  • -g is for Global
  • -x if for eXport
rayfranco
  • 121
0

This seems to be what you are looking for:

https://wiki.archlinux.org/index.php/Tmux#Setting_the_correct_term

lsd
  • 1,723