Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
I think screen has its own color option that has to be enabled in its config if it doesn't detect it right. –  xenoterracide Jan 23 '11 at 18:04
    
@xeno Screen already has color. Its only when SSH is up that it go to only white –  TheLQ Jan 23 '11 at 19:22
add comment

1 Answer 1

up vote 3 down vote accepted

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
share|improve this answer
    
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 '11 at 18:34
add comment

Your Answer

 
discard

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.