I am using Vim inside the Windows Subsystem for Linux. The windows command prompt has a bug which renders the background color incorrectly.
The fix is set t_ut=
. Rather than applying this fix in all situations, I assume it would make sense to only apply it when Vim is being used inside the Windows console.
Unfortunately, I am not sure how to detect whether the Windows console is being used, because I am inside the Windows Subsystem for Linux.
Foobar :
I used the following code that implemented Roadowl's comment.\n\nlet uname = substitute(system('uname'),'\\n','','')\nif uname == 'Linux'\n if system('$PATH')=~ '/mnt/c/WINDOWS'\n \" We are in Windows Subsystem\n endif\nendif\n\n\nUpdate: I combined roadowl's and bk2204's answer:\n\nlet uname = substitute(system('uname'),'\\n','','')\nif uname == 'Linux'\n let lines = readfile(\"/proc/version\")\n if lines[0] =~ \"Microsoft\"\n return 1\n endif\nendif\n",
2019-07-13T00:44:26