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..
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.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
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.
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 :-)
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar