Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 06-07-2002, 10:24 PM   #1
LQ Newbie
Registered: Jun 2002
Location: Manila, Philippines
Distribution: Slackware, Redhat
Posts: 2

Rep: Reputation: 0
Environment Variables: xterm, ls, mc, and emacs colors


I have switch from redhat 7.2 to slackware 8.1rc1 just a few days ago and I have a small problem. I did a basic install, ie only base system, development, and libraries. Next I compiled, installed, and configured XFree86 4.2, then fluxbox, then emacs. After compiling and installing all my favorite programs entered startx everything was cool except for xterm and emacs.

Under xterm i did an ls and everything was in one color. I tried mc and it was in one color, lynx is in one color... you get the idea. I fixed ls by editing /etc/profile so that DIR_COLORS was being loaded and set. The fix for mc and lynx currently is to do an TERM=xterm-color before running them in an xterm. I tried other terms as well, eterm and gterm. They are all in one color. Any ideas on how to fix this? I want my xterm colors to behave in the same way as it did on Redhat. I tried editing my .Xdefaults file but nothing seems to work.

Now for emacs. I usually run a shell within emacs so that I can do all my work in one window. I tried to ls in a shell buffer and it displayed all escape codes as well. I did an env and it said that the LS_OPTIONS was set to (something, something) --color=auto. I was like huh?!? I checked my .bashrc .bash_profile /etc/profile /etc/bashrc and they don't have any lines that set that environment variable. I tried grepping all the files in /etc and nothing seems to set this variable by default. Is this compiled in default or something? echo TERM says I'm in a dumb terminal and all the programs that don't work in a dumb terminal say so when I try to run them in an emacs shell buffer. Isn't --color=auto supposed to work the way I think it's supposed to work? I mean it should not try to colorize output on a dumb terminal. I didn't have these problems previously on rh7.2 and mind you I don't want to reinstall that sucker or any future redhat stuff from this point on.

I tried looking at my /etc/termcap and I copied /etc/termcap-BSD over the default one from the slackware package. xterm still behaves the same. ls in an emacs buffer still behaves the same. Any help? Please reply to this post or send me email.

Thanks in advance and best regards.
Old 06-07-2002, 10:52 PM   #2
Registered: Apr 2002
Location: Michigan
Distribution: Slackware 8.0
Posts: 197

Rep: Reputation: 30
This is what I have in my .bashrc file to have different colors. Hope this helps

eval `dircolors -b`
Old 06-12-2002, 10:59 PM   #3
LQ Newbie
Registered: Jun 2002
Location: Manila, Philippines
Distribution: Slackware, Redhat
Posts: 2

Original Poster
Rep: Reputation: 0
ls is already fixed. It already displays listings in color as noted in my first post. However the problem now is when I do an ls in an emacs shell buffer (M-x shell). ls fails to recognize that it's in a dumb terminal and spits out escape codes along with the listings.

When I do an env, the environment variables say LS_OPTIONS was set to (something, something) --color=auto. I haven't done any of this. And I removed the line that says options in DIR_COLORS and still the --color=auto flag is set. Is this default behaviour? Do I have to rebuild fileutils from sources?

Another problem is with mc, if I just open an xterm and run mc, it does not display in color. I have to do an export TERM=xterm-color and rerun mc to get it to display in color. mc seems to work fine in rxvt (I think I hear someone say "Then USE RXVT!!!") but all the keyboard stuff is messed up.
Old 08-31-2003, 04:11 AM   #4
LQ Newbie
Registered: Jan 2003
Distribution: Gentoo
Posts: 8

Rep: Reputation: 0
.bashrc, .bash_profile

I had a similar problem. My xterm (started with "xterm -ls", to make int a login xterm) seemed to forget that the $TERM vas set to "xterm". It was set to "vt220", and that was of no use for me (in vim, mc, etc. the colours and keycodes were messed up).

I finely found the problem in .bash_profile, somewhere in it the sneaky line "export TERM=vt220" was found, and once deleted everything was back to normal.

So if your problem is with system variables that you don't remember setting, check both /etc/<files that could do it>, but also /home/<yourname>/.<other files that could do it too>
Old 09-01-2003, 01:06 AM   #5
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
I had a similar problem with aterm not displaying vi properly. I edited my fluxbox menu to use this command:

aterm -ls -tr -trsb -rv -sh 60 -fade 50 -tn rxvt

to call aterm. (There's also some aterm specific edits for the rxvt entry in termcap, but this shouldn't concern you) The important flags here are '-ls' for a login shell and '-tn rxvt' which tells xterm (in your case) to run with the terminal name 'rxvt' and use rxvt's termcap entry. I'm not sure if this will solve your problem, but it's worth a try.

--- Cerbere


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
man pages with colors in xterm milod Linux - Software 4 03-30-2006 11:34 PM
Editing Emacs colors? ljr2600 Mandriva 4 09-18-2004 06:50 AM
rxvt/xterm colors macondo Debian 2 04-20-2004 07:10 PM
ls colors in xterm/rxvt/aterm Pougan Linux - Software 8 12-01-2003 11:24 AM
emacs colors ZoZo Linux - Software 1 10-29-2002 03:44 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration