LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Environment Variables: xterm, ls, mc, and emacs colors (https://www.linuxquestions.org/questions/slackware-14/environment-variables-xterm-ls-mc-and-emacs-colors-22880/)

kulitpuro 06-07-2002 10:24 PM

Environment Variables: xterm, ls, mc, and emacs colors
 
Hello.

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? :confused: 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.

Sfin 06-07-2002 10:52 PM

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

eval `dircolors -b`

kulitpuro 06-12-2002 10:59 PM

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.

emanuelgreisen 08-31-2003 04:11 AM

.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>

Cerbere 09-01-2003 01:06 AM

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.

Enjoy!
--- Cerbere


All times are GMT -5. The time now is 12:18 PM.