Because of an old application that apparently partially looks at termcap and partially hard-codes terminal info, a customer has to set TERM=ansi when using Alphacom to access his Linux box.
The Linux colorizing fouls things up royally. You can shut off command line colorizing by editing /etc/DIR_COLORS and changing "COLOR tty" to "COLOR none" or (less drastically) by removing the "TERM ansi" line from the same file (which removes colorization for ansi but doesn't affect console use).
But that still leaves vi messing things up. The fix for that is to add
set t_Co=0
# t_C0=2 turns off MOST colors, 0 kills all
to the top of /etc/vimrc. I attempted to do this in ~/.vimrc but couldn't make it work, and also tried
if &term=="ansi"
set t_Co=0
endif
in /etc/vimrc but that didn't work either.. not sure why yet. The idea there would be to let vim colorize if not using ansi, though in my case forcing it is fine because I don't want colors in vi ever.
I have seen the suggestion to "set syntax off"; that didn't work for me or the customer. I also tried using the "nosyntax.vim" file in /usr/share/vim/vim63/syntax, and even downloaded a "black and white" color scheme from http://www.vim.org/scripts/script.php?script_id=335, but vim still stubbornly would show colors for errors. Only the t_Co=0 worked.
To my mind, colorizing is pretty messed up..
Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

| Views for this page | ||||
|---|---|---|---|---|
| Today | This Week | This Month | This Year | Overall |
| 31 | 100 | 78 | 4,470 | 32,182 |
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Mon Mar 14 20:22:47 2005: Subject: TonyLawrence
Frustratingly, the person who originally had this problems says that his screen still turns blue in vi.. with Alphacom, but not Powerterm.. makes no sense to me, but we'll ask the Alphacom folks if they can shed any light on this..
Wed Mar 16 20:42:38 2005: Subject: TonyLawrence
Just the difference between t_Co=0 and t_Co=2
Sat Sep 24 23:00:56 2005: Subject: BigDumbDinosaur
I personally find vim's use of text colors real annoying, primarily because I'm partially color-blind. On my SCO box (which is where I still do a lot of my work) I either work in monochrome (usually green on black -- old habits die slowly) or have set text colors that are high contrast and do not mix blues and greens (my color-blindness is the relatively rare blue-green type -- most color-blindness is red-green). The widespread use of blue backgrounds in applications poses a real problem for me, as combinations like black on blue, light green on blue and so on are barely visible to me. The page borders displayed on this site when running in border mode are almost invisible relative to the white background of the main frame. Another visually annoying application I use is Microlite's Backup Edge. The default color combination (blue background, white foreground) results in an eye-watering session.
Mon Jun 26 05:42:59 2006: Subject: anonymous
this works on an ad-hoc basis:
:syn off
Tue Aug 22 04:23:14 2006: Subject: anonymous
I too am colorblind (juts red-green here). As if that's not bad enough, I am ADHD too. The colors are not only annoying but incredibly distracting. Just give me my text--nothing fancy, just good ol' vi!
Wed Jan 3 17:16:44 2007: Subject: color highlighting for comment in VI vp70
do following to change color highlighting for comment from darkblue (default) to darkgray
if &term=="rxvt"
set term=xterm
endif
if &term=="xterm" || &term=="rxvt"
set t_Co=8
map ,u :source ~/.vimrc<CR>
endif
syntax enable
hi Comment cterm=none ctermfg=darkgray ctermbg=none
Thu Jan 11 03:23:30 2007: Subject: Gail anonymous
I agree that color in vi is messed up at least on my redhat linux system in an xterm. Sorry, but I did not find the suggestion here helpful. Exactly where does one type the magic "set t_Co=0"?
However, for straight up vi (i.e. not vim) , the suggestion here worked like a charm.
http://www.cyberciti.biz/faq/turn-on-or-off-color-syntax-highlighting-in-vi-or-vim/
Thanks for a great and helpful site and forum.
Control Spam and Viruses
Run your own mailserver
Thu Jan 11 11:59:01 2007: Subject: TonyLawrence
You add it to /etc/vimrc
How can you say it didn't work if you didn't know where to add it? :-) That link you gave is just the "set syntax off", which as I said above didn't work for me. I think that shows how screwy vim is: one thing works for you, the other for me. It's a messed up thing.
Fri Feb 1 21:07:38 2008: Subject: Vim RichardBronosky
Vim is perfect. We are flawed. Anytime I think Vim has a problem, I find that I am wrong about 6 months later.
Fri Feb 1 22:28:06 2008: Subject: TonyLawrence
Well, I'm a big vi fan - every single page I post here was written with vi - but it does have its faults just the same :-)
Add your comments