WSL zsh Integrated VSCode User account change? - visual-studio-code

Hi not sure if this is possible or not to achieve, but I am looking to change the user account that is set when launching zsh terminal in VSCode from showing "Administrator" to "~" like it shows when you run VSCode with remote WSL and stand alone Ubuntu terminal.
Launching default VSCode:
Image
Launching VSCode via Remote WSL extension:
Image

Related

I have to open visual studio code as administrator or I won't be able to open a terminal

I have the latest version of VSC installed on a Windows 10 machine. If I run VSC regularly, so not as an admin, then if I try to open a terminal I get a 740 error. If I start VSC with Administrator privileges everything works fine.
What could be causing this? I would prefer if I didn't have to run VSC with Admin privileges.
P.S.
I'm using VSC its integrated Terminal.
If I switch to Command Prompt as external Terminal, the problem is gone. But I would prefer to continue to use the integrated Terminal.
There are some other Slack topics that point to ensure not running VSC in compatibility mode, which is indeed disabled on my end.
I found out the cause. Git Bash was configured as the Integrated Terminal of VSC. Its run file C:\Program Files\Git\bin\bash.exe was configured in Windows to "Run as Administrator". As a result, I also had to start VSC "as administrator" to open a Terminal. After unchecking the box "Run as Administrator" for Git Bash, I no longer need to run VSC as administrator to be able to open the Terminal.

VSCode will not run default terminal upon startup

For months I have been using Git Bash as my default terminal. Upon start up it loads 1 terminal plus any additional terminals as defined in my "terminals.json" file using the "Terminals Manager" extension. Everything has been working fine up until today, when I opened vscode up and it launched powershell instead of Git Bash for all my terminals. I have restarted vscode, and also restarted my pc but that did not help.
As mentioned above it is my default profile:
And here are my settings:
Also btw I can still run bash on vscode and it works just fine, however it won't run on start up anymore.
Any idea what is happening?

Looking for help on setting up wsl in vscode terminal

If I'm in my terminal and open a file with the code command, vscode will launch and the terminal inside code will show my full zsh setup that I have configured in hyper terminal. But if I open up code through windows, and select wsl as my default shell, it's pretty much useless. Anything I try, like sudo, git, apt, etc will return a command not found message.
So if I want to commit any changes in the terminal inside code then I have to use the git bash shell. Is it possible to get my zsh working without first launching from my terminal emulator so I'm using wsl instead of git bash?
running wslconfig.exe /list in powershell showed me that WSL was set to docker as the default shell, so then running wslconfig.exe /setdefault "Ubuntu" in powershell fixed my problem.

How do i open a local terminal from a remote session in VScode?

When i open my workspace in VScode i go directly into my SSH work area, which is what i want. But i want to have a split terminal with access to both my SSH-work area and a terminal for my local computer, but i cant access the local one without making an explicitly new terminal from the dropdown window. And if i try to split the new local terminal i get the error "The terminal shell CWD "/Users/asd/work/" does not exist" as if its being looked for in my SSH work directory. Is there any way of specifying the default terminal to be on my local computer? If i do so in the terminal preferences in VScode i get the CWD-error on startup instead.
This should have been resolved with microsoft/vscode-remote-release issue 1479
Both of you don't have C:\Windows\System32 on your path, I don't understand why that is.
But I will change this to not rely on the PATH.
Even if this was for Windows originally, opening a local shell, (Mac or Windows) should now be possible while having a remote session.
Wtih ctrl+shift+p or cmd+shift+p(Command Palette), you have:
Terminal: Create New Integrated Terminal (local)
Bonus, with VSCode 1.53 (Jan. 2021), there is now:
Remote layout persistence
Terminal layout is restored on remote terminal reconnection. In the video below, the terminal layout is restored when reloading VS Code and reconnecting to a Windows Subsystem for Linux (WSL) remote instance.

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.