• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 92
  • Last Modified:

How do I prevent colors from changing when vim is invoked ?

Prevent color change when vim is invoked.

My computer is running Windows 10 Pro 64-bit.  I connect to remote Linux Machine using telnet utility.

My shell is bash.  My terminal emulator screen has black background and white foreground.  I invoke vim <filename>.  I exit vim and return to
my terminal.  Now the terminal has changed colors.  man vim doesn't have color option that will tell me how to disable color when vim is inovked.
0
naseeam
Asked:
naseeam
  • 3
  • 3
  • 3
  • +1
3 Solutions
 
nociSoftware EngineerCommented:
export TERM=vt100

either setup in .bashrc or on a commandline.
0
 
Dr. KlahnPrincipal Software EngineerCommented:
There are so many linux programs that think it's clever to change colors that it's hard to nail down all of them.  It may be more practical to address the problem in the terminal emulator.

Most terminal emulators have the capability to disable color setting, or set colors to whatever color you want.  So either disable color setting, or set  all text colors to white and all background colors to black.

PuTTY color configuration
0
 
arnoldCommented:
I've never seen. Exiting vim, changing the prior term view.
:! Invokes the shell from within vim.
:q quits vim, returning back to the display you had when vim was launched.

Could you post a screen shot of
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
naseeamAuthor Commented:
setting terminal to vt100 didn't make any difference.

Attached are screenshots of my telnet emulator color settings.

Also attached excel file contains screenshots of changed colors.

I think telnet terminal emulator colors change before I was experimenting with colors in vim ?
telnet_Screen_Text_white.PNG
0
 
arnoldCommented:
the display was of the windows command prompt settings.
Where does the change manifest?
Have not run into such a situation so can not say what might be going on.


Telnet is an insecure (plain text data stream) and should commonly be disabled with providing access only though an ssh client.

which telnet emulator are you using?
0
 
nociSoftware EngineerCommented:
That looks like the command (or CMD) window and native telnet command to me.
The preferred way for logons to unix systems (or any networked systems) is SSH (putty implements that). This is because ancient tools (Telnet, FTP, etc) from the 1970's have absolute trust in networks and transmit passwords & usernames without encryption across a network. Please covert to using ssh access protocol and forget aoubt ftp/telnet's existence as being useful.

I am still missing the 'export TERM=vt100' from the .bashrc?
what does echo $TERM show?

You may also like to use nano instead of vi.
0
 
naseeamAuthor Commented:
changing terminal to vt100 doesn't make any difference.

Is it possible to fix this problem in telnet ?
0
 
arnoldCommented:
unalias ls

this way directory lising will no longer be in a color scheme.
0
 
nociSoftware EngineerCommented:
export TERM=vt100 doesn't change the terminal in ANY way.....

export tells bash to export the TERM variable to teh environment strings of all programs it calls. (so a program can get it's value with getenv("TERM").  and term won't work, Term neither, spelling is case sensitive. TERM is needed.
without export the variable stay private for the shell that is running.
the vt100 part must be vt100, not Vt100 or VT100 ...
(it refers to a filename on the system in this case /etc/terminfo/v/vt100   )

Many tools use [n]cusrses /terminfo library for screen management (vi does) en vi looks for the TERM variable to determine what commands are needed for 'clearscreen()' , cursor_gotoXY(), select_reverse(), select_normal() etc.etc.
see /etc/terminfo/... and vt100 is a classic very popular terminal with a standards compliant set of commands sequences without colors.
although it had attributes like blink, reverse, underline it is fairly easy to emulate so that explains the popular choice.
export TERM=dumb  might work as well, although  lots of commands to clear screen or position a cursor will be lost as well.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 3
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now