Conemu: Console Vim: PgUp and PgDn / <C-u> <C-d> Redraw Problems

Created on 19 May 2017  路  16Comments  路  Source: Maximus5/ConEmu

Versions

ConEmu build: 170517 alpha x32
OS version: Windows 10 Creator's Update x64
Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): cmd

Problem description

  • Getting screen redraw issues in terminal vim when using PageUp/PageDown or / to scroll through buffers
  • No problem when scrolling using up and down/j and k keys
  • Problem not present in either graphical vim (gvim.exe) nor in terminal vim using ConsoleZ
  • Problem does not seem to be resolved despite a blanked-out _vimrc
  • Occurs with windows versions of terminal vim, but surprisingly, vim run through WSL does not seem to suffer the same issue
  • Problem persists even in a handful of past versions of ConEmu

Steps to reproduce

  1. In terminal vim, press PageUp/PageDown or /. Buffer would redraw improperly.

Actual results

Depending on the scroll direction, about half of the screen buffer text disappears

Expected results

...

Additional files

vim-conemux86-redraw-problems
Settings,
screenshots,
logs,
etc.

Most helpful comment

I found a fix. There are number of options available for vim that control how it behaves when sending output to terminal. So it seems that defaults just doesn't work well with conEmu. So to fix the issue just use :set ttyscroll=0 (actually you can set to higher value for details read docs on option).
Also Maximus5 if you can, it would be nice if you read chapter 4 at http://vimdoc.sourceforge.net/htmldoc/term.html and maybe you can suggest some better way to fix it.

All 16 comments

I do not see "terminal modes" status bar column. It looks like you are not using connector (non msys/cygwin vim).
Also, it's but clear if you are using xterm emulation.
At the moment I do not believe the same problem can't be reproduced without ConEmu.
Third-party application problems

No sense to compare with WSL version or GVim. Both are too different from standard Windows console application.

Sorry if I wasn't too clear. This is just the plain vanilla vim.exe that comes installed automatically with graphical vim/gvim for windows, so I'm not running cygwin/msys. Strangely enough, I encounter no redraw-on-scroll issues when running vim.exe from either command prompt (cmd) nor from ConsoleZ, albeit without the excellent color support that conemu provides.

Hi raffylopez, can you try Vim from this link,
http://solar-blogg.blogspot.ca/p/vim-build.html
I have almost the same setup and everything works perfect.

Thanks @grygus, but that didn't do the trick for me, nor did installing and running vim v7.4.872 and v8.0.599. I'll investigate a bit further when I've the time.

After setting the console size to 78 width and 35 height, the redraw-upon-pagescroll problem seems to have vanished. Not completely out of the woods though, since the redraw problem manifests itself again when a buffer is horizontally split into at least two panes and either one is page-scrolled.

Again. I don't believe you can't reproduce that without ConEmu.
Same conditions, sizes, RealConsole properties, and after reproduction - just report the bug to Vim authors.

I've made a quick recording of running vim under cmd, then in conemu. Near the end of the GIF you can see that the redraw bug under conemu seems to have gone when viewing in a single buffer (after the previously-mentioned screen dimensions redef), but then bringing up a split, then scrolling, still produces the anomalous redraw problem.

screengif

I have the same issue. Makes it hard to use vim in comemu as on scroll half of the screen just goes blank. I was unable to reproduce using standard cmd/powershell and console2. I'm running vim for windows.

Some more info on the issue. I was able to narrow it down a bit. It is reproduced only when scroll step (:set scroll=) is greater than 50% of lines visible. So e.g. i have 69 lines fit into visible area. As soon as I set scroll step to 35 I start getting redraw issue. But I do not get it if I set 34 and below. I also noticed that when I resize conEmu the vim setting (set scroll) gets automatically updated. And looks like it tries to keep this value to match 50% of lines visible but sometimes seems to set value higher than 50% and that when issue emerges.

I found a fix. There are number of options available for vim that control how it behaves when sending output to terminal. So it seems that defaults just doesn't work well with conEmu. So to fix the issue just use :set ttyscroll=0 (actually you can set to higher value for details read docs on option).
Also Maximus5 if you can, it would be nice if you read chapter 4 at http://vimdoc.sourceforge.net/htmldoc/term.html and maybe you can suggest some better way to fix it.

Which Vim version do you use? Official/cygwin/msys/wsl?
Do you use xterm emulation?

I use official. No xterm emulation.
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 23 2017 19:48:19)
MS-Windows 32-bit console version
Included patches: 1-586
Compiled by mool@tororo

If you do not use connector and do not use term=xterm, than all bugs should be reported to Vim authors. ConEmu has absolutely no control over its output!

@raffylopez If you don't use xterm emulation, than you should be able to reproduce the bug without ConEmu. Open RealConsole properties and compare it with vanilla conhost, set the same options...

Agree, it is not a ConEmu bug and not a vim bug either I think. It is just that vim requires some extra configuration for particular emulators/terminals.

@ddiukariev Setting ttyscrollto a low value solved the issue entirely for me as well. It's a rather obscure setting, I should say, but good call!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MandarSant picture MandarSant  路  3Comments

joanis picture joanis  路  3Comments

pyhedgehog picture pyhedgehog  路  3Comments

vampiricwulf picture vampiricwulf  路  5Comments

xkx picture xkx  路  3Comments