[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: can 256color be recognized automatically?
From: |
Chris Jones |
Subject: |
Re: can 256color be recognized automatically? |
Date: |
Sat, 14 Mar 2009 04:50:09 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Thu, Mar 12, 2009 at 06:57:38PM EDT, Christian Ebert wrote:
> Hi,
>
> $ screen -v
> Screen version 4.01.00devel (FAUd87a0d8) 2-May-06
>
> that's latest from git repo, and latest ncurses(w) + xterm.
>
> At the moment I have to set explicitly
>
> term "screen-256color"
> to get 256 colors working. Otherwise $TERM stays simply "screen",
> even when called from an xterm-256color environment.
> Sometimes, albeit rarely I switch to Apple's Terminal.app
> (nsterm-16color), and I'd like to get screen-16color there
> without having to set it explicitly.
>
> Is this possible? What am I doing wrong?
Maybe you could use a wrapper that tests the underlying terminal's color
capability & sets the $TERM environment variable?
ncl=$(tput colors)
case "$ncl" in
'16')
TERM=screen /usr/local/bin/screen
;;
'256')
TERM=screen-256color /usr/local/bin/screen
;;
esac
Totally untested, only to clarify the above.
CJ
Re: can 256color be recognized automatically?, Christian Ebert, 2009/03/14