7

I am attempting to keep a nested ssh session inside of a byobu/screen window, which I also connect to over SSH with Putty on Windows.

However the nested SSH session has no color. Here's what I'm talking about:

Lack of color

On the left you have byobu connected to wreckcreations with no color. On the right you have Putty connected directly to wreckcreations with color. Note that normally byobu has color when working locally.

I tried messing with $TERM, $PSI, and other variables to no avail. Any idea's what would cause this?

2
  • I think screen has its own color option that has to be enabled in its config if it doesn't detect it right. Jan 23, 2011 at 18:04
  • @xeno Screen already has color. Its only when SSH is up that it go to only white
    – TheLQ
    Jan 23, 2011 at 19:22

1 Answer 1

5

It could be many things.

Please provide the output of:

echo $TERM
echo $LS_COLORS
typeset -p LS_COLORS
alias ls
tput setaf 1 | od -c
echo "$(tput setaf 1)red$(tput sgr0)"

Expected results:

xterm (optional, see below)
no=00:... (or similar, should not be empty)
declare -x LS_COLORS="no=00:..." (ditto)
alias ls='ls --color=auto' (or similar)
0000000 033   [   3   1   m
0000005
red (in red)

My guess: TERM is set to something unusual, and dircolors doesn't know about it, therefore ls doesn't know what colors to use.

If this is the case, running the above commands inside your byobu/screen session, you would see:

screen (or screen-something)
(nothing)
(nothing)
0000000 033   [   3   1   m
0000005
red (in red)

Confirm that this is the case by running:

dircolors -p | grep "^TERM $TERM$"

I would expect it to print nothing.

The simplest fix, depending on your configuration, would be:

dircolors -p > ~/.dircolors
echo "TERM $TERM" >> ~/.dircolors
2
  • Got a whole bunch of strange results in byobu from your batch of commands. But your last config finally fixed the problem. Thanks!
    – TheLQ
    Feb 6, 2011 at 18:34
  • @Mikel, thanks ls --color=auto solved my issue Apr 8 at 9:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .