VSCode terminal in ubuntu wsl - visual-studio-code

I've run into an issue where when I open vscode through WSL (command code.) it opens VSCode with no terminal whatsoever and there's no option to open one.
Terminal on WSL Ubuntu:
But when I run vscode from Windows I do have the option to use my Ubuntu terminal
Terminal on Windows:
Has anyone had similar issues? Did I miss a setting somewhere in VSCode?

Related

How to use the WSL and CMD terminal from VsCode terminal?

I can only use the bash, tmux, and javascript debug terminal in VsCode. I can't use the CMD and WSL terminal.
I tried to change it in the default terminal profile but there's no CMD and WSL there.
Press on Configure Terminal Settings and open setting.json file and add this line
"terminal.integrated.defaultProfile.windows": "Command Prompt",
Go to VSCode to learn more about terminal integration.

nvm and gulp found on Visual Code terminal but not on linux terminal

I have Ubuntu LTS 20.04 running on wsl2 in Windows, this way I'm able to compile my JS/React code and run my php server in linux and use windows to code using Visual Studio Code.
This is running great, but a strange thing is happening, I installed nvm and gulp through the Visual Studio Code terminal and if I use them on the terminal it works fine but not if I do it outside the terminal (using Windows terminal), it says not found for both gulp and nvm.
I assume VSCode is adding a few things to the PATH but I don't know what to do for them to be found by the windows terminal (outisde VSCode terminal). Screen below. On the left is the result of running nvm list inside VS Code terminal and on the right on Ubuntu terminal, which can't find.
I'm a bit confused by your question. It sounds like you're installing programs on Windows through the VSCode terminal, and then trying to run them on Windows but it's not working. But then your screenshot shows the WSL Ubuntu prompt failing to find the command. Assuming you want to run these under WSL, log in to WSL Ubuntu and run this:
find / -name nvm
If you actually want to use the Windows terminal to run the program, you'll have to find where it is installed in Windows and make sure that's in your %PATH% but this doesn't seem like it's what you're trying to do.
The correct answer was provided by the comment from MindSwipe.
On VSCODE terminal if I "echo $PATH" it has the nvm directory in it while the $PATH on WSL doesn't, I assume VSCODE alters its own terminal PATH when the tools are installed using it instead of the global WSL path.
I've changed the WSL path and it's now working, how can I present the bounty to MindSwipe ?

Using WSL through CMDER in VSCODE

I have setup WSL in CMDER through settings->Startup->{WSL::bash} and also made it my default shell, so whenever I open CMDER it starts in WSL.
I integrated CMDER into VSCODE using https://github.com/cmderdev/cmder/wiki/Seamless-VS-Code-Integration and it is working. But the CMDER version opening inside VSCODE is not the default WSL shell.
How can I setup CMDER with WSL as shell, inside VSCODE?
I found the solution, I got the WSL shell with CMDER in VSCODE by adding the following in settings.
{
"terminal.integrated.shell.windows": "path\\to\\cmder\\vendor\\conemu-maximus5\\ConEmu\\wsl\\wslbridge.exe"
}
CMDER tab shows wslbridge.exe when I open WSL shell in CMDER. So I searched for wslbridge.exe inside CMDER folder and added the path in VSCODE settings and it worked.
I am not sure if this is the perfect solution or if this causes any issues in the future but it works for now.

VSCode: Different terminal account

I am using VSCode in Linux Ubuntu for my coding purposes. And I use the the existing terminal in the VSCode, The Terminal in VSCode and the OS terminal share the same history of commands. Is there any way to have separate profile for VSCode so that the each of the terminals have its own history.

Use Linux Subsystem bash for Visual Studio Code integrated terminal

I have the Linux subsystem enabled on my Windows 10 laptop, and I'm using Debian
I was able to use Cygwin as VS Code's integrated terminal, with the help of this guide:
VS Code - Cygwin as Integrated Terminal
But I'm using OpenCV in some of my projects, and installing it on Cygwin is pretty tricky AFAIK. Can I use Debian's terminal as VS Code's integrated terminal?
Thanks
If you enabled Bash On Windows (WSL console) you should, with this config, be able to have the bash as VScode terminal:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe",