Score:0

Visual studio code command doesn't work on WSL 2

mx flag

For some reason, when I type the command code . from a WSL terminal I have the message:

Command is only available in WSL or inside a Visual Studio Code terminal.

After some research, I tried to fix it with the following commands:

  • rm -r ~/.vscode-server
  • code .

It redownloads VS Code Server and it works correctly but just for one terminal instance. When I open a new terminal, I still have the message :

Command is only available in WSL or inside a Visual Studio Code terminal.

I don't have the issue when I use the command code in a VS code terminal.

Score:0
cn flag

open up a command line session, for example Powershell and type

wsl

then enter

code

It should clear it up. If not, then adjust the path after entering the wsl layer and try running

code

again.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.