WSL: Console doesn't correctly support Vim color themes

Hi

I am trying to get vim to display 24-bit colour since I saw it was now supported on the latest insider build of windows - https://blogs.msdn.microsoft.com/commandline/2016/09/22/24-bit-color-in-the-windows-console/

I cannot seem to get it working for some reason. This is my vimrc file:

set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call pathogen#infect()
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'
Plugin 'christoomey/vim-tmux-navigator'

call vundle#end()
filetype plugin indent on

colorscheme solarized
syntax enable
set background=dark
let g:solarized_termcolors=256
colorscheme solarized


set number
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab

And this is what vim looks like: http://oi67.tinypic.com/2hs3yba.jpg

Also when I try and use

hi normal ctermfg=white ctermbg=navyblue

I get an error that NavyBlue is undefined but

hi normal ctermfg=white ctermbg=darkblue

Works, so vim only detects 16 colours.

Is there a solution for this or am I configuring it wrongly?

Thanks

Kabeer

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 27 (8 by maintainers)

Most upvoted comments

Yeah, that’s likely something for @zadjii-msft to take a look at. I’ve filed a bug for us to triage & track (10996879)

@snicke Still a bug, still on the backlog, still MSFT:10996879. Hopefully I’ll have enough time to get to it this release cycle.

I have the same problem as @KVohra95 and also wonder about the current status of the issue. Just installed Windows 10 Creators Update and the issue is still there.

Thanks. Looks like you’re still running an Ubuntu 14.04 instance; you may want to consider upgrading it to 16.04 or nuking it and re-creating, which will install 16.04, but you’ll have to reinstall all your tools & settings afterwards.

Looks like you’re running a fairly recent Vim build - same as the one I’m using, in fact.

Looks like you’re experiencing the Vim background color erase issue described beautifully in this post: https://sunaku.github.io/vim-256color-bce.html

The solution to this issue is to set the following two lines to your .vimrc:

set term=screen-256color
set t_ut=

Take a look at my .vimrc that resulted in the following:

Gruvbox (https://github.com/morhetz/gruvbox): 2017-02-16 gruvbox

Monokai (https://github.com/sickill/vim-monokai): 2017-02-16 monokai

Solarized (https://github.com/altercation/vim-colors-solarized): Alas, the Solarized vim theme appears to cause issues - I’ll explore this with @zadjii-msft for our next release. 2017-02-16 solarized