Visual Studio Code 2019 terminal not opening - visual-studio-code

I was using visual studio code 2019 for C++ Programs, and suddenly now I have seen that when I press Ctrl + ~ my VS code terminal is not opening.
It gets open and close again. It is not showing any error.
I tried uninstall and install again of VS code and I tried changing setting.json modification. I am not sure what it is going wrong.
Please Note: after all this I tried using code runner but it was not helping, so
I again uninstalled it.
My setting.json is like below
{
"terminal.integrated.inheritEnv":true,
"code-runner.runInTerminal": false,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"C_Cpp.default.compilerPath": "",
"terminal.integrated.automationShell.windows": ""
}

I have not a good fix but probably it can work.
Follow this step by step and hope it fixes it for you.
Step 1: Uninstall VS Code using Program and Features.
Press Windows Key + R
Enter appwiz.cpl
Press enter.
The Uninstall a Program window will be open. Find VS Code and uninstall it from there.
Close the window.
Step 2: Remove the saved data from the Local folder.
Press Windows Key + R
Enter appdata
Press enter.
The AppData folder of your current use will open. Now do:
Double Click and Open Local folder.
Find the folder named Programs and Open it.
If you see the folder named: Microsoft VS Code then delete it. (Only do it after you delete VS Code from Uninstall a Program) else, return to the Local folder.
Close the folder.
Step 3: Remove the saved data from Roaming folder.
Press Windows Key + R
Enter Appdata
Press Enter
The Appdata folder will open again.
Double Click and Open Roaming folder.
Find the folder named: Code and delete it. (Only if you have deleted VS Code from Uninstall a Program)
Now install the setup of VS Code and install it again. This issue, most probably solved. This is because the left over setting of VS Code can be stored in your PC in order to use again if install. So casual reinstallation can't help. If you remove the saved folder the previous settings will not be inherited as they will not exist. A new folder will be created and thus new setting will be used which can be set accordingly again.
Hope this helps to solve your problem. :)
Thank You! :D

I was able to solve this with installing again Powershell.

Related

Updating vscode doesn't show user code snippets

Updating vscode doesn't show user code snippets.
If I move the cursor after entering the prefix, it appear only then.
This issue can be resolved by following these steps:
Close Visual Studio Code.
Go to your user snippets folder, usually located at ~/.config/Code/User/snippets (for Linux), %APPDATA%\Code\User\snippets (for Windows) or ~/Library/Application Support/Code/User/snippets (for Mac).
Backup your user snippets folder by renaming it to something like snippets_backup.
Reopen Visual Studio Code.
Check if your user snippets are appearing now.
If the above steps don't solve the problem, you can try clearing the Visual Studio Code's cache:
Go to the Command Palette (Ctrl + Shift + P on Windows, or Cmd + Shift + P on Mac).
Type in "Developer: Delete Settings File".
Select the option "Developer: Delete Settings File" from the dropdown.
Confirm the deletion of the settings file by clicking on the "Yes" button.
Reopen Visual Studio Code.
These steps should resolve the issue with your user code snippets not appearing after updating Visual Studio Code.

How to change folder that opened by default in VSCode?

I have small problem with VSCode folder, that opened by default.
Problem description: I start new instance of VSCode (trough File->New Window), and then if I choose File->Open Folder it opens dialog with my Windows user folder as starting point (C:\Users\MyUser)
Question: How can I change that folder in settings (if it possible)? So by default it will show as start point for example D:\development\ ?
At the time I write this answer, this is not possible. There are two problems on Windows, and one problem on Mac and Linux:
VS Code does not provide a default path to the file dialog 1. It does remember the last folder that you opened a file in, but that path cannot be used as a default because it is overwritten constantly.
On Windows only, Electron ignores the default path when creating a file dialog if the default path is a directory 2.
An extension also cannot solve this, because extensions are not allowed to modify the File menu 3.
I think the best option at this point is to pin a folder to the Quick Access area in Windows Explorer, as suggested in a comment, or to put an actual shortcut in the user profile folder.
Workspaces and File > Open Recent may also be helpful if you often open the same folders.
Your main problem is that you are unable to open your specific folder in VScode.
To solve that you can simply open the terminal/cmd in that specific window by just typing cmd in your search bar or just by pressing shift+right-click in that folder.
Now your cmd is open and you just have to type "code ." in the cmd and press enter to open the current folder in your VSCode.
In case that code . doesn't work for you then you have to add the Vscode in the environment variables of your windows.
Visual Studio doesn't provide a specific feature to open a specific path. But there is a solution to your problem. You are saying that you want D:\develpment as a default when you open VS Code. You can go to that specific directory or create shortcut to desktop then click right click on that folder and then click on open with code. If you didnot see open with code then reinstall your VS code and check on open with code when you are reinstalling VS Code.
make a shortcut on the desktop for vscode and then modify it and add the folder after the .exe command. This will default open that folder when you double click on it.
Visual Studio Code can be installed in two ways - User setup and System setup. I strongly believe you have User setup installed in your PC. Try re-installing it System-wide. That should probably fix your problem.
For more information: https://code.visualstudio.com/docs/setup/windows#_user-setup-versus-system-setup
PS: A lot more information is needed, you can share a screenshot of the window and elaborate more on it.

How do I factory reset Visual Studio Code or Delete Folders

I started to learn one language and moved to a different one. I want to start with that language with a fresh code editor. But I don't know how to reset visual studio code and delete all my data. Can someone help me? I'm quite new to vs code. (Sorry if this is a stupid question)
You can delete VSCode related data comletely by deleting both of these or if you just want to reset your editor just delete the .vscode folder in your user profile.
To Delete user data directory Code:
Windows %APPDATA%\Code
macOS $HOME/Library/Application Support/Code
Linux $HOME/.config/Code
To Delete the extensions and other related data, delete the folder named .vscode:
Windows %USERPROFILE%\.vscode
macOS ~/.vscode/
Linux ~/.vscode/
Press CTRL + SHIFT + P
Type "settings json"
Click "Preferences: Open Settings (JSON)"
Edit file and leave only braces { }

How Can I Always Reset My Workplace Settings for Every Time I Quit VS Code?

What I want is to have all of my workplace preferences reset every time I quit VS Code. Right now, if I quit the application and opened the same folder I previously closed, VS Code still retains all pointer positions and all opened files. This maybe good for a lot of people, but for me, I just feel overwhelmed.
What I have tried:
I tried to locate .vscode folder but it is non-existent in my project folder.
"Clear Command History" doesn't work.
"Clear Editor History" doesn't work.
Following this link ---> https://github.com/Microsoft/vscode/issues/42948 and deleting /home//.config/Code/Local Storage doesn't work.
Following this link ---> https://github.com/Microsoft/vscode/issues/42948 and running window.localStorage.clear() in Electron development console returns undefined.
I am using Ubuntu 18.04.
In the settings menu you can search for window.restoreWindows and change that to none. You can also change workbench.editor.restoreViewState to false which might also help.

How to undo "Don't show this prompt again" in vscode python?

Accidentally selected "Don't show this prompt again" when prompted to install Pylint in VSCode Python. How should I undo/reset the action so the prompt will appear again?
See the issue notes here: https://github.com/Microsoft/vscode/issues/24815
You might have to do this:
deinstall Visual Studio Code
delete C:\Users[Username].vscode
delete C:\Users[Username]\AppData\Roaming\Code
or relevant paths on your operating system.
To anyone coming here from Google, if you're looking to reset the "Are you sure you want to move 'file' into 'folder'?" prompt:
On macOS, open /Users/[username]/Library/Application Support/Code/User/settings.json and remove "explorer.confirmDragAndDrop": false.
It's a similar process on Windows and Linux ✌️
Here is how to do it on macOS without uninstalling VS Code or delete globalStorage:
Quit all VS Code instances (Cmd +Q)
Instal SQL Lite browser https://sqlitebrowser.org
Go to: /Users/[user_name]/Library/Application Support/Code/User/workspaceStorage/ => Find the one that associate with your workspace that you previously clicked "Don't show this promt again" (by looking into workspace.json and identify the name)
Open stage.vscdb file with SQL Lite
Look for data key "ms-vscode.csharp"
Edit "assetPromptDisabled":true to "assetPromptDisabled":false
Save change
Reopen vs code
https://github.com/microsoft/vscode/issues/24815#issuecomment-547733206