Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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/, but a new fish (initiated outside tmux) always has TERM set to xterm.

share|improve this question
Since this question was just upvoted, I should mention that I reported this as an issue on GitHub. It is known, and now documented, behaviour. – sjy Sep 7 at 11:39

2 Answers 2

set -gx TERM screen-256color-bce;

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

share|improve this answer

This seems to be what you are looking for:

share|improve this answer
That page describes what I'm trying to do (set TERM to screen-256color-bce), but it doesn't explain why I can only set this variable locally in the fish shell. – sjy Jan 18 '13 at 4:07
set -g default-terminal "screen-256color" – lsd Jan 18 '13 at 12:52
I have never used fish shell, so I may not be much help. Try some debugging, but some echo statements just before the set and after, make sure they are run, and print the value of TERm right after it is set.... if the debug statements don't print, it is possible the script isn't being run. – lsd Jan 18 '13 at 13:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.