VS Code ssh remote is not opening file in new tabs - visual-studio-code

Recently vs code got updated and post that all files of remote server is opening in one tab only. Tab feature is working fine when opening files from local machine but when connected to remote server on ssh, only one file is opening. Tried many suggestions shown in online forums but nothing is working. Please help.

This was intermittent issue, i could not fix it but i found workaround for this while connected to remote servers. There is option to keep the tab open. Hope it helps anyone who is having similar issues.

Related

Live server vs code is not working and any of the solutions work

I have downloaded live server but it is not working. It doesn't show me any error messages like it does to others. I tried reinstalling it, I tried reinstalling vs code too, but nothing happened. I see from people which have it working that it displays on the tab of the IDE but for me it’s not there. I try to open it with right-clicking on one of the HTML files but nothing happens. I also checked my default browser and added it to the json.file.
I just decided to install an earlier version of the live server extension and it worked.

VSCode crashes on startup (code: -1073741818)

Yesterday, VSCode (1.67.1) decided that it was unable to start (crashes immediately) and spits out the error code -1073741818. I have the option to reopen or close but nothing happens regardless of the option chosen. Thought it might be an issue with the file/folder I was opening but no success opening any files/folders at all. Tried to disable GPU, disable extensions and re-install but all lead to the same error code. Tried to move to Atom, but, oddly enough, the same issue occurred. Discovered Atom and VSCode are both based on Electron and that Electron has previously had issues with Nvidia drivers (currently running 512.77) so I tried to install previous versions of the drivers that were working but no success. I finally gave up and moved the code to another system and everything works flawlessly.
So now I that I have some time, I am trying to figure out what went wrong and where to go from here. My uninformed, uneducated guess is it is driver related but I am not sure how to resolve it. I was able to successfully use VSCode earlier in the day with no issue. The system went into stand-by mode and upon return, the issue began. Any suggestions/guidance on where to start would be greatly appreciated.
VSCode Crash Window
Welcome to the community! I think this is caused by an corrupt installation of vscode, try to restart your computer and maybe reinstall vscode by going to, https://code.visualstudio.com.
If that does not help maybe try to submit an issue on the vscode github here: https://github.com/microsoft/vscode.
How to submit an issue on github:
Find the menu bar where it has multiple menus, it should have: "code", "pull requests" and "issues".
Click on "issues" button.
Click "new issue" to create an issue.
Then click "bug report" and enter details to file issue.
Once ready click submit issue to submit your issue in github.
Also, you'll need a github account to create a issue, signup here: https://github.com/
I hope this helps!
Please check if you've installed any additional extensions which may be causing the VSCode to crash.
My VS code keeps crashing when opening it
I had the same problem. First, it used to crash once every 10 minutes, then it started crashing 10 times a minute after a few hours. It just stopped working that day.
I don't know how it was resolved but it did automatically resolve.
I searched for the solution but the VS code on GitHub was already closed. If applicable take a rest and let your PC calm down also. Then if the problem doesn't get resolved, try contacting the developer team.

Failed to connect to the remote extension host server (Error: Handler already set!)

I went to open a repo using Vs Code on a remote ssh host. I can ssh in successfully but when I try to open a repo I get Failed to connect to the remote extension host server (Error: Handler already set!). I've tried un installing and re installing Vs Code. Does anyone have a fix other than switching ides.
avenmore comment helped me:
I started getting this message with v1.57.0 when trying to run a Vue
project. Long story short: I usually have my DEBUG CONSOLE window
docked inside to the right of my TERMINAL (powershell), and upon
opening VSCode it wouldn't be visible and I'd get this message after
building successfully and trying to launch. The work-around is to
close VSCode, navigate to folder
USERPROFILE%\AppData\Roaming\Code\User\workspaceStorage and delete the
contents (notably state.vscdb) and then restart VSCode. The DEBUG
CONSOLE then shows itself again and all is fine unless I dock it again
and close VSCode and there is a good chance of it happening again next
time VSCode is opened. I have stopped docking the window inside the
terminal and it hasn't happened since.
For me what solved this was to go into the 'remote explorer' and clear out the SSH Targets that I already had in there before the upgrade, and then just paste them in again. Now I can connect. For example, a re-pasted SSH command looked like:
ssh -i "/Users/myuseraccount/abc.pem" someuser#ec2-ip-instance1.compute.amazonaws.com
A few days later this stopped working again. I think maybe because my SSH targets config saved what I pasted in as my SSH connection command. It appears "sometimes" if there are any entries in the SSH target config file, that this error occurs.
I find to ensure this error never occurs do
rm ~/.ssh/config
every time before you open Vs Code. Assuming ~/.ssh/config is where your Vs Code is reading its SSH entries from. There is one other place possible under /etc/$somewhere (I dont know where).
Then when you go to your empty SSH Target and hit the (+) button to connect, paste in the entire ssh connection request at the top of this file. I think you have to clear out the SSH targets every time otherwise I get this error coming up again days later.
Try in settings.json add item "security.workspace.trust.enabled": false
Windows, VSCode 1.57.1
I've just remove and added the host again in ssh configuration:
If you are using MacOS, I found a way.
Close Visual Studio Code, delete files in these two folder, then restart Visual Studio Code.
rm -rf $HOME/Library/Application\ Support/Code
rm -rf $HOME/.vscode
I tried all solution on this post, and can't get success. Then cloned another repo on my WSL folder then open, it was fine. So I changed my repo name, then problem gone. Maybe it may dumb solution. But it works me.
You gonna have to change the "debug.terminal.clearBeforeReusing" to true on setting.json. It works for me
I noticed there was a workspace folder in the folder above, deleted that and it resolved the issue
On the remote system, after various things had happened, I did mv .vscode .vscode-old to basically reset the remote .vscode (over ssh). I had also renamed the remote folder for the project -- not sure if that matters. Then I was was able to connect to it again.
I can't be scientific about those "various things that happened", but I'll to list some:
I had created a second project alongside the first and had connected to it - this was for unrelated reasons and preceded the "handler" error
it was then that I had issues connecting to the first one, even though it had worked for months and months without me ever having this Handler already set error -- related to creating the 2nd one? Not sure. The 2nd one worked fine throughout.
I tried File: Open Folder... from the second remote project and opened the first; it opened but got 2 python exception errors in a python extension - unfortunately I can't remember what they were. This could be noise / unrelated. I happen to have both MS python and pylance extensions installed remotely, I think it was the pylance once that was not happy.
during this, I had also renamed the 1st folder which didn't work; I'm not sure if the rename triggered the different behaviour ie python ext errors instead of the "handler" error
I then replaced .vscode in the first remote project (with the new folder name)
... and that was when it worked, with no "handler" error and no complaints from the python extension(s)

VSCode unable to connect SSH to raspberry pi 4

I'm facing an annoying problem which just popped out of the blue overnight: VScode will not, under any circumstances connect to my raspberry pi 4 via ssh. I'm using VScode insiders with the remote-ssh extension and it worked like a charm the weeks before.
What works:
Putty connects seamlessly over LAN or WiFi.
ssh is enabled on rpi4
i am using the correct IP which i get from hostname -I in the terminal
What doesn't work:
neither "raspberrypi" nor "my correct IP" work. Right after selecting "Linux" in the selection process it throws the error "Could not establish connection to "my correct IP""
uninstalling VScode insiders and deleting all related files in docs and appdata changes nothing after reinstallation
What i observed:
This happened to me before in VScode for no reason and was unfixable. On a forum post someone recommended using insiders, which fixed the problem but now VScode insiders seems to be affected by this as well. Whenever a connection couldn't be established, two problems pop up in my extensions tab:
"Error while loading extensions. Error"
"We cannot conect to the Marketplace at this time, please try again later."
Especially the last one gives me a feeling that this is a bug within VScode. I'll gladly take the blame if it's on my behalf, i just want to fix the problem.
Similar things have been mentioned here:
"Extension host terminated unexpectedly" in vs code
Remote SSH in Visual Studio Code does not work
but are unsolved or don't quite fit my description. Thank you for your time and help.
Screenshot of my VScode insiders: https://imgur.com/a/uODtBlE

VSCode: opening one remote file using rcode closes another

I recently started looking at VSCode as a possible substitute for Sublime 3 (I use Mac OS Sierra 10.13.1). I regularly work with code on a remote server, so I installed "rcode", following the steps in https://codepen.io/ginfuru/post/remote-editing-files-with-ssh.
Everything seemed to be working nicely, until I tried editing two files at the same time:
rcode file1.py
rcode file2.py
Each time I opened a new file from the remote server, the first one closed automatically, leaving me with just file2.py open.
This is really frustrating, since I need to go back and forth between them, and I can't find any information on this issue. I have the same problem using "rmate".
Has anyone else run into something similar and is there a work-around? I never had a problem working with multiple files in Sublime.
It's not a perfect solution, but if you change "workbench.editor.enablePreview" to false in your settings, rmate (and probably rcode) will open files in new tabs.