This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: exiting vim changes background colour of console


On Wed, 19 Oct 2005, Robert Bram wrote:

> Hi Igor,
>
> Thanks to you and Corinna for the feedback so far!
>
> > > > > ==
> > > > > I am finding that when I exit from vim, it turns my background
> > > > > back into black (which is how I had it before I tried changing
> > > > > it today). Is there a setting or something I have forgotten to
> > > > > change?
> > > > > ==
> > > > > Actually this is happenning not just after vim.. but even after
> > > > > I exit "less"!
> > > >
> > > > Works for me.  Did you close the console window and re-open one after
> > > > changing the colors?  Before doing this, the console colors are known
> > > > to be scrambled as you describe above.
> > >
> > > Yes I closed and re-opened the console and the problem recurs. :-/
> >
> > vim (and less, since you seem to have the same problem there) use
> > something called an "alternate screen".  This is a feature of the terminal
> > that allows the program to make arbitrary modifications to the terminal
> > screen that will be undone when the program switches back to the main
> > screen.  In particular, any color changes will be undone.  Consequently,
> > if you wish to change the color of the main screen, don't do this while
> > running vim or less.
> > HTH,
>
> I admit to being somewhat confused by your remark - I didn't change the
> screen while running vim or less. I edited the properties of the console
> so that it would affect all consoles with the same name, changed the PS1
> environment variable in my .bash_profile, closed the console, re-opened
> it, ran vim and/or less, exited vim and/or less and then found the
> console colors changed. Have I misunderstood your point?
>
> Interestingly, I find that I can keep pressing ENTER and 'clear' the
> screen back to how it was, but this is an ugly solution.

What is the value of your PS1 variable?  Does it, perhaps, contain the
code at the end that resets the background?  That was the only way I could
reproduce the behavior you report on my machine.

> -----Original Message-----
> From: Igor Pechtchanski [mailto:pechtcha@XX.XXX.XXX]
> Sent: Wednesday, 19 October 2005 4:28 AM
> To: Robert Bram
> Cc: cygwin@XXXXXX.XXX
> Subject: RE: exiting vim changes background colour of console
>
> [FULL QUOTE snipped]

<http://cygwin.com/acronyms/#PCYMTNQREAIYR>.  Oh, and please don't make
<http://cygwin.com/acronyms/#TOFU>.  Thanks.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]