11

I get a strange issue with ubuntu on wsl.

When I want to modify a txt file on Ubuntu or Debian (via WSL in Windows), the content of the terminal empties and I see nothing (the content of the text file is invisible) :

I create a simple text file with some content

enter image description here

And when I want to read/modify the file with vim (same issue with vi and nano), I get this empty terminal :

enter image description here

On this empty terminal, if I press i then some text then escape + :x and then enter, I get that :

enter image description here

And the text some text has been added to the file :

enter image description here

I tried Debian on WSL and I get the same issue ! impossible to use vim, vi or nano because of this issue :/

I uncheck and re-check the window feature "Windows Subsystem for Linux" but the issue still..

Thanks for any help :)

EDIT :

The return of the command $TERM :

enter image description here

1 Answers1

16

Try to set $TERM to xterm-color. With this change I got vi, vim and nano working.

export TERM=xterm-color

and try your favorite editor again. And to make it permanent add it to your ~/.profile or ~/.bashrc

This started after installing Cumulative update for Windows Server 2019 (KB5007206). Also removing this update I was able to get vi, vim and nano working on WSL.