tl;dr: My path was using the an old Vim version, with v8.1.428 we have full 24-bit glorious colours in Vim in the Windows Console! See below for screenshots.
Err, so there was a basic mistake on my part. I still had my system environment path pointing to my Git SCM installation C:\Program Files\Git\usr\bin
(which contains an older version of Vim) and on top of that I had the same directory before my new Vim installation directory of C:\Program Files\vim\vim81
in the user environment path. I should have noticed that the Vim version was incorrect.
Now that I've solved that mistake I've got the following :version
:
:version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 22 2018 22:02:51)
MS-Windows 64-bit console version
Included patches: 1-428
Compiled by appveyor@APPVYR-WIN
Huge version without GUI. Features included (+) or not (-):
+acl +cryptv +gettext/dyn -mouseshape +scrollbind +user_commands
+arabic +cscope -hangul_input +multi_byte_ime/dyn +signs +vartabs
+autocmd +cursorbind +iconv/dyn +multi_lang +smartindent +vertsplit
+autochdir +cursorshape +insert_expand +mzscheme/dyn +startuptime +virtualedit
+autoservername +dialog_con +job -netbeans_intg +statusline +visual
-balloon_eval +diff +jumplist +num64 -sun_workshop +visualextra
+balloon_eval_term +digraphs +keymap +packages +syntax +viminfo
-browse -dnd +lambda +path_extra +tag_binary +vreplace
++builtin_terms -ebcdic +langmap +perl/dyn +tag_old_static +vtp
+byte_offset +emacs_tags +libcall +persistent_undo -tag_any_white +wildignore
+channel +eval +linebreak -postscript +tcl/dyn +wildmenu
+cindent +ex_extra +lispindent +printer +termguicolors +windows
+clientserver +extra_search +listcmds +profile +terminal +writebackup
+clipboard +farsi +localmap +python/dyn -tgetent -xfontset
+cmdline_compl +file_in_path +lua/dyn +python3/dyn -termresponse -xim
+cmdline_hist +find_in_path +menu +quickfix +textobjects -xpm_w32
+cmdline_info +float +mksession +reltime +timers -xterm_save
+comments +folding +modify_fname +rightleft +title
+conceal -footer +mouse +ruby/dyn -toolbar
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME\_vimrc"
2nd user vimrc file: "$HOME\vimfiles\vimrc"
3rd user vimrc file: "$VIM\_vimrc"
user exrc file: "$HOME\_exrc"
2nd user exrc file: "$VIM\_exrc"
defaults file: "$VIMRUNTIME\defaults.vim"
Compilation: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_TERMINAL -DFEAT_JOB_CHANNEL
-DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG /Zl /MT -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_MBYTE -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86t.dll\" -DDYNAMIC_TCL_VER=\"8.6\"
-DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python37.dll\" -DFEAT_MZSCHEME -I "C:\Program Files\Racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracket3m_a36fs8.dll\" -DDYNAMIC_MZGC_DLL=\"libracket3m_a36fs8.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl528.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=24 -DDYNAMIC_RUBY_DLL=\"x64-msvcrt-ruby240.dll\" -DFEAT_HUGE /Fd.\ObjCULYHTRZAMD64/
/Zi
Linking: link /nologo /subsystem:console,5.02 /opt:ref /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib netapi32.lib uuid.lib /machine:AMD64 libcmt.lib user32.lib /nodefaultlib:lua53.lib /STACK:8388608 /nodefaultlib:python27.lib /nodefaultlib:python37.lib "C:\Tcl\lib\tclstub86.lib" WSock32.lib /PDB:vim.pdb -debug
Now the magic happens! Running has("termguicolors")
returns 1
. So set termguicolors
in .vimrc
works and suddenly the colours of my :AirlineTheme
convert to the correct colours. If I set :AirlineTheme solarized
, I get AirlineTheme colours that match GVim exactly:

The disappointment is that the main colorscheme solarized
colours are now ruined, however setting colorscheme default
gets us a reasonable range of colours (this is with solarized set as my console colours).

However I've got tender a 24-bit theme for me to test with. Setting colorscheme tender
in my .vimrc
gives some lovely omg-Ive-got-real-proper-syntax-highlighting-in-vim-in-dos colours!


Now testing again with xterm-color-table.vim gives a lovely range as I'd hoped it would.

Many thanks to the Windows console team and the people doing the work to get this into Vim.
Edit: Using the vim-solarized8 theme which is optimised for 24-bit terminals I now have full glorious solarized too:

:hi
you should be able to tell, whether the gui attributes are used (24bit) or only the terminal colors (256 colors)