jnurmine / Zenburn

Zenburn is a low-contrast color scheme for Vim.
http://kippura.org/zenburnpage
891 stars 149 forks source link

problem with colors in ConEmu #16

Closed lkurylo closed 8 years ago

lkurylo commented 8 years ago

Hi. I have a problem with colors when I scroll the page. Check the below gif: zenburn

This is a minimal vimrc to reproduce this: https://gist.github.com/lkurylo/f6a20801b48133a71fac With the configuration for encoding, I must change the codepage (chcp 65001) before I launch vim in console. I have no idea what can be wrong.

jnurmine commented 8 years ago

Hi,

I have no experience with ConEmu, but I think what you see is due to some bad interaction with it and the Vim version used - it looks like the color sequences are perhaps interpreted incorrectly.

I suppose your setup is already according to the ConEmu page, with the inject enabled etc., and the Vim version is not a Mingw build, and so on?

Now, I've seen similar (but not exactly same) issues with terminal multiplexers like screen and tmux. To fix these, I have the following in my .vimrc (for me, the TERM is usually "xterm-256color"):

if &term =~ '256color'
    set t_ut=
endif

This is used to disable the background color erase. In your case, since you use ConEmu and set the term="xterm" and never run another configuration, you should just have "set t_ut=".

Can you please try "set t_ut=" and see if it helps you?

lkurylo commented 8 years ago

The set u_ut= changes nothing in my case and the ConEmu is properly configured, otherwise the colors won't work. And this is a standalone Windows version, not from e.g. cygwin.

I'm curious about the BCE. If this is the problem, I believe that, I should have this problem every time I scroll the text yes? This is not always true, e.g. with the solarized light theme this problem doesn't occur.

jnurmine commented 8 years ago

I guess you did set t_ut, not u_ut?

The BCE did not kick in every time for all lines for me, the background was "shining through" in some cases. One could see a line with proper color and then another line with a different (background) color etc. It's hard to explain but the there were blocks of wrong color. Not exactly like the issue you describe though.

From the GIF it looks like as long as you move the cursor within the window, things are OK. The moment you scroll, some colors vanish, as well as bold attributes seemed to vanish. If I saw something like that under Linux, I'd venture a guess that the termcap is somehow broken or the terminal definition is wrong.

I am pretty sure this is not a problem in the colorscheme but rather something in ConEmu, something (I don't know what) is not handled properly.

Do you see any change if you :set scrolloff=10 (for example)?

lkurylo commented 8 years ago

Yes, I typed t_ut. It was a typo. With scrolloff is the same (actually I already have a set so=7 in my vimrc ;) zenburn2

jnurmine commented 8 years ago

Hey, if you press CTRL-L when the display is trashed, does it refresh properly? Or does it stay broken?

If it refreshes properly, it might be a bug in some redraw-related thing in the ConEmu, maybe it does not refresh often enough or tries to optimize changes or such. If it stays broken, the bug is probably earlier in the "pipeline" (I imagine as pipeline the sequence of commands which start from the interpretation of the color sequences and culminates in drawing on the display).

lkurylo commented 8 years ago

Yes, the ctrl+l works ok. That's how I clear the sceen in the gif above. Setting the :set lazyredraw also helps a little. Check the gif in this topic at ConEmu Issue tracker: https://github.com/Maximus5/ConEmu/issues/359#issuecomment-146773237

lkurylo commented 8 years ago

It's been fixed in ConEmu 151025