On Sun, May 11, 2008 at 07:45:06AM +0200, Jesus Sanchez wrote:
> Girish Venkatachalam escribis:
>> On 22:20:18 May 10, Jesus Sanchez wrote:
>>   
>>> Hi, I'm using OpenBSD 4.2, a clean install.
>>>
>>> I have experienced some problems using screen and X with colorsls. The
>>> issue is that when I launch 'screen' on virtual terminals (C0,C1...) I
>>> don't have any problem but when launch X, on the xterm/rxvt I have
>>> open I can't launch a screen because the colors goes mad and shows
>>> white on black combinations I have not set on my rxvt (I use some grey
>>> tones combinations).
>>>
>>> I have set an alias for ls='colorls -GF' (color output) and this causes
>>> the problems on a screen session. I have set the TERM="xterm-color" on
>>> my /etc/profile.
>>>     
>>
>> As Stuart pointed out you should not do this.
>>
>> I used to experience hell since I used to make the same mistake. ;)
>>
>> Later life got simple after doing a code walk through of screen's source
>> and figured that the problem is fixed by setting
>>
>> $ export TERM=rxvt 
>> ;)
>>
>> Funny we arrive at simple solutions through circuitous routes. ;)
>>
>> -Girish
>>
>>
>>   
> I tried to set the TERM variable to rxvt value "export TERM=rxvt"
> on the /etc/profile and I have problems with the virtual terminals now.
> (the ones invoked by Ctrl+Alt+F1 to F4). I get weird color
> when doing colorls -G in screen session, so your solution it's
> not valid to me, but thanks for the info.

Don't do that.

You really need to learn a bit more of Unix before you start making changes
in system-wide files.

Unix administration is relatively easy, but this is still stuff you need
to learn.

Putting personal choices in system-wide files is a really bad habit,
even if you are on your personal machine.
Especially when your personal choices are bogus in the first place.

Sooner or later, you'll manage to break the machine config, and then you'll
figure out you can no longer login normally, and end up needing to take
down the machine violently. With luck, fsck and single-user will get you
out. With no luck, fsck will fail and you will have to reinstall partly.

Stuart explained this specific case in a sibling message.
TERM only reflects your current terminal. There is no way you can put
settings that work for everything, you have to use some kind of judo.
Specifically, don't change TERM yourself, convince your subsystems to
set it correctly for you, either through the use of /etc/ttys for the
console, or through the use of resources for X windows emulators.

Do this carefully: first test manually on a specific session, then do
the changes in *your* config files, and then decide whether you really
want to do this on a system basis.

In the end, you'll end up with a sane configuration at the system level,
and your personal config files set up carefully.

A big advantage of doing this on your config files is that, over the years,
you'll end up with a configuration you can transport from machine to machine
as you gain user accounts on other people's machines, where you usually
cannot change system-wide files...

Reply via email to