msknathan / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

Background erase colour not updated when restoring cursor #328

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run a fullscreen terminal program such as vim that has a different color 
that the terminal (example, my terminal has a purple background, vim has a 
black background)
2. Exit the program
3. Colors will mess up in certain cases now. For example, backspacing 
characters. Or opening a man page.

What is the expected output? What do you see instead?
My terminal background color should be all I see. But after doing this, I 
occasionally see the alternate color (black instead of purple)

What versions of mintty, Cygwin/MSYS, and Windows are you using?
mintty 1.0.3
cygwin 1.7.11

Please provide any additional information below.

Original issue reported on code.google.com by Alexcali...@gmail.com on 24 Mar 2012 at 4:38

GoogleCodeExporter commented 9 years ago
After a bit more playing around with it, this only seems to happen when I quit 
vim using
:q
if I write a quit (:wq), the colors are fine.

Original comment by Alexcali...@gmail.com on 24 Mar 2012 at 5:33

GoogleCodeExporter commented 9 years ago
I can't reproduce that, either with default vim settings nor with syntax 
highlighting enabled.

Are you using a particular colour scheme? Maybe that has a bug, leaving the 
background colour set to ANSI black instead of the default background colour on 
vim exit. You could work around it by having your prompt reset the colours. 
Cygwin's default bash prompt does just that.

Original comment by andy.koppe on 14 Apr 2012 at 4:48

GoogleCodeExporter commented 9 years ago
I'm not using a particular color scheme to my knowledge. I admit I may be doing 
it wrong, but I had just set the background of vim to black manually in the 
.vimrc file.

However, I looked up Cygwin's default bash prompt and stole the relevant color 
reset portion of it (I'm not fantastic at those control sequences), and 
everything works. It's probably my fault for setting the vim color incorrectly 
or something.

Thanks and I hope I didn't waste too much time.

Original comment by Alexcali...@gmail.com on 17 Apr 2012 at 3:40

GoogleCodeExporter commented 9 years ago
No worries. How do you set the background colour in .vimrc? (I want to make 
sure that mintty isn't behaving differently from xterm here.)

Original comment by andy.koppe on 17 Apr 2012 at 7:54

GoogleCodeExporter commented 9 years ago
relevant .vimrc lines:
hi normal ctermbg=black
set background=dark

my .vimrc is otherwise unmodified from the stock cygwin install.

Original comment by Alexcali...@gmail.com on 18 Apr 2012 at 7:30

GoogleCodeExporter commented 9 years ago
I also can confirm this behavior. My terminal's background is black (default), 
but I use a Vim theme with a bright background. If I quit Vim with :q, then 
clearing the screen (with clear or <C-l>) in the terminal leaves its background 
bright (the same as my Vim theme's background color). If I quit Vim using :wq 
then all is fine.

One thing I should mention is that I've set my term to be xterm-256color in my 
.mittyrc.

Original comment by kohanyi....@gmail.com on 22 Apr 2012 at 5:39

GoogleCodeExporter commented 9 years ago
This doesn't happen in xterm, nor in PuTTY. It happens in mintty when new lines 
are scrolled in from the bottom. Apparently I introduced this bug with mintty 
0.6.

Original comment by andy.koppe on 25 Apr 2012 at 5:00

GoogleCodeExporter commented 9 years ago
Fixed in r1263 on 1.0 branch. I introduced the problem in r826 on the 0.6 
branch, wrongly dropping the update of the erase character's attributes when 
restoring a saved cursor.

Original comment by andy.koppe on 26 Apr 2012 at 12:27

GoogleCodeExporter commented 9 years ago

Original comment by andy.koppe on 6 May 2012 at 6:53