Vim background color renders incorrectly #1134

Open
opened 2026-01-30 22:17:17 +00:00 by claunia · 0 comments
Owner

Originally created by @caksoylar on GitHub (May 15, 2019).

Originally assigned to: @zadjii-msft on GitHub.

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.18362.86]

  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)
    In conhost or Windows Terminal, using both Vim.exe and WSL Vim, background color rendering becomes broken if a background color >16 or true colors is used.

With an example file, e.g. https://github.com/GilbertsHub/web-utils/blob/master/cgibinIntercept.sh:

vim -u NONE cgibinIntercept.sh +"hi Normal ctermbg=17" # for Windows: +"set t_Co=256"
# scroll down with CTRL-D

In general it is much easier to reproduce in WSL than Vim.exe, because it doesn't seem to occur after the initial scroll on Vim.exe and the effects are a bit different as described below. I can reproduce with any combination of conhost/terminal and Vim 8.1.883 on Ubuntu/8.0 on Debian/8.1 on Win32. Does not reproduce with neovim (v0.4.0-430-g8698830cb).

A few cases of example behavior:

  • Debian with conhost, Vim from official repository
$ sudo apt install vim
$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)
Included patches: 1-197, 322, 377-378, 550, 703, 706-707

vim-bg
Same behavior in the new terminal.

  • What's wrong / what should be happening instead:
    Background rendered the whole width of the window, e.g. in wsltty:
    vim-bg-wsltty

The effect is very similar to the issue https://github.com/microsoft/terminal/issues/375, however that one happens with bg color set to <16 (darkBlue). However I cannot reproduce that issue anymore, including the terminal bg change.

The issues for Win32 and Linux versions might be separate, since their effects are pretty different as described above.

I also haven't been able to reproduce this using VT sequences, but I hope the bug report is still useful.

Originally created by @caksoylar on GitHub (May 15, 2019). Originally assigned to: @zadjii-msft on GitHub. * Your Windows build number: (Type `ver` at a Windows Command Prompt) Microsoft Windows [Version 10.0.18362.86] * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) In conhost or Windows Terminal, using both Vim.exe and WSL Vim, background color rendering becomes broken if a background color >16 or true colors is used. With an example file, e.g. https://github.com/GilbertsHub/web-utils/blob/master/cgibinIntercept.sh: ```bash vim -u NONE cgibinIntercept.sh +"hi Normal ctermbg=17" # for Windows: +"set t_Co=256" # scroll down with CTRL-D ``` In general it is much easier to reproduce in WSL than Vim.exe, because it doesn't seem to occur after the initial scroll on Vim.exe and the effects are a bit different as described below. I can reproduce with any combination of conhost/terminal and Vim 8.1.883 on Ubuntu/8.0 on Debian/8.1 on Win32. Does not reproduce with neovim (v0.4.0-430-g8698830cb). A few cases of example behavior: - Debian with conhost, Vim from official repository ```bash $ sudo apt install vim $ vim --version VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38) Included patches: 1-197, 322, 377-378, 550, 703, 706-707 ``` ![vim-bg](https://user-images.githubusercontent.com/7876996/57801234-26729d00-7708-11e9-8006-c1adc1bbbbcf.png) Same behavior in the new terminal. - Vim.exe on conhost cmd.exe installed from https://github.com/vim/vim-win32-installer/releases/download/v8.1.1099/gvim_8.1.1099_x64.exe ![vim-bg-conhost](https://user-images.githubusercontent.com/7876996/57803566-959ec000-770d-11e9-8c95-8a0ee6c13ef8.png) Background color is wrong on the text part but correct otherwise (purple, although this seems to depend on active colorscheme) but is fixed after a Ctrl-L redraw. - Vim.exe on Terminal cmd.exe, same as above ![vim-bg-terminal](https://user-images.githubusercontent.com/7876996/57802546-13ad9780-770b-11e9-88c6-1cba57e4fa9d.png) Background color is again wrong, but the background highlight completely disappears after a Ctrl-L redraw. * What's wrong / what should be happening instead: Background rendered the whole width of the window, e.g. in wsltty: ![vim-bg-wsltty](https://user-images.githubusercontent.com/7876996/57802542-101a1080-770b-11e9-93dd-338d8410e04f.png) The effect is very similar to the issue https://github.com/microsoft/terminal/issues/375, however that one happens with bg color set to <16 (`darkBlue`). However I cannot reproduce that issue anymore, including the terminal bg change. The issues for Win32 and Linux versions might be separate, since their effects are pretty different as described above. I also haven't been able to reproduce this using VT sequences, but I hope the bug report is still useful.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1134