If you add/change some environment variables (e.g. PATH) on windows, even after restarting 'VS Code' it will not be available in VS Code integrated terminals.
But if you open that terminal from windows (Command Prompt/Powershell/...) it will have those new/updated values!!
What should I do to refresh those environment variables? (without restart or log-out)
You need to run the following line in a new window of one of your terminals (Command Prompt, Powershell, ...):
code
It will open 'VS Code' once from them.
Now you can close and re-open 'VS Code' again as many time as you want using its normal shortcuts and have your environment variables.
This manually resets the path variable in the specific PowerShell terminal.
$env:Path = `
[System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + `
[System.Environment]::GetEnvironmentVariable("Path","User")
Chocolatey comes with a RefreshEnv.cmd utility for this purpose, which worked for me. More convenient than opening other code instances.
I got the following to work (at least on VS Code 1.62.00).
Restart VS Code
Open a new terminal (via Terminal->New Terminal or Ctrl+Shift+` or with the + on the top right of the terminal window), do NOT use the existing terminals or View->Terminal.
Make sure that you are on the new terminal, as many times after restarting VS Code it might try to restore the old terminal.
The new terminal should be up to date.
The following approach worked for me.
Close VS Code
Right click the VS Code icon pinned to the task bar
Open VS Code again using the "New Window" option
The new environment variable will now be available
Related
I am trying out the Remote - Containers VSCode extension. I get a docker warning and a prompt message if I want to continue but I can't type anything into the terminal. The cursor looks like it's active but nothing happens when I type.
So far I have tried:
Using iTerm.app instead of Terminal.app (in VSCode settings)
Disabled oh-my-zsh terminal plugin
Quit and start Visual Studio code
I solved this by using generating ssh key in the devcontainer and adding it to github.
Anaconda was installed by Systems Team on my work computer.
For reasons beyond this topic, they installed in Program Files, which I think is non-optimal.
So I ask permission to remove the installation and reinstall it via standard procedures.
When I open Anaconda PowerShell prompt it is still pointing to the Program Files installation which I have removed.
I have also checked the Path environmental variable, and there is nothing looking like Anaconda is still there.
How can I get Anaconda PowerShell prompt to work again?
It should be noted that conda command does work in regular command prompt.
Thanks.
Initialize conda for use with Powershell via
conda init powershell
This command should be run in Anaconda Prompt.
Before following #Peter's solution, I was able to track the problem via a more rustic procedure.
Right click on Start Menu's Anaconda PowerShell Prompt, and select Open File Location.
Right click on the icon's Properties, select Shortcut tab > Target field.
Copy the command to a text editor, and noticed it was still using an old location.
Changing the command to point to the right location did fix the problem.
... but that is only the command from the Start Menu, the rest is done by what was suggested before.
Thanks for the help.
Have installed angular CLI via node js command prompt. However, when I launch terminal in VS code, it doesn't allow to type only. PFA screenshot
PFB terminal setting screenshot
Able to run ng commands from node js command prompt outside vs code.
If your problem is not related to default shell in your terminal. Then you check windows settings. Follow the steps -
Open VSCode file location
Go to Compatibility tab in VSCode properties window
Unchecked Run this program in compatibility mode for: option
see the attached files. Try with this solution, it might help you.
This worked for me:
Remove settings file.
Click on view/terminal.
Select default shell.
When using IntelliJs integrated terminal - for example with git - sometimes my CTRL + C keystrokes don't make to the terminal. For example the current line is not aborted.
What can I do as this behaviour is very annoying.
As I had git for Windows installed anyway I just replaced the terminal used by IntelliJ from cmd.exe (which is the default on windows) to bash.exe supplied by git for Windows (which is cygwin btw)
To change it for all projects go to File >> Other Settings >> Default Settings and then Tools >> Terminal. (see screenshot)
In the shell path field set the following line:
"C:\Program Files\Git\bin\bash.exe" --login -i
Please make sure git is installed at the proper localtion or adjust the path (for example if you have the 32bit version of git installed)
Using bash instead of cmd, the problem does not occour for me. Plus the bash supports some commands that cmd does not support, which is kinda nice when been used to a linux environment.
EDIT 2020-09-30: In latest Intellij versions the Terminal is a project-level setting and can be changed here:
Sometimes it could be because of vim emulator just turn it off
Go to Tools
Deselect Vim Emulator
Because Vim mode is checked,
Tools, Vim Emulator, there will be a √ in front of it, just cancel it, as shown in the figure:picture
I hope i can help u.
I am running win7 professional 64-bit. I have already installed java, and am trying to install ActiveMQ. The install worked perfectly on a Windows Server 2003 machine but now it is giving me issues on my win7 machine. I download ActiveMQ 5.3.2 extract the files and then try to run the installservice.bat file as administrator and it gives me the following error in command prompt: '"wrapper.exe"' is not recognized as an internal or external command, operable program or batch file.
I had the same issue when using Windows Explorer and right clicking on the InstallService.bat file and selecting "Run As Administrator".
However, this worked for me (without having to change my user control settings):
1) Open a command prompt (right clicking first with "run as administrator").
2) Then navigate to the folder where your batch file is and simply type InstallService.bat.
Ok I feel a little stupid answering my own question but here it goes. Turn off the user control settings in the control panel
I had the same issue with apache-activemq-5.6.0 and solved it this way:
Open cmd.exe as admin (click on Start, type in cmd, right click on the "cmd" program, and choose Run as administrator)
In the cmd.exe window, navigate to your apache-activemq-5.X.X root dir (which contains bin, conf, data, docs, ...)
From there, navigate to bin\win64
Your commmand prompt should show something like:
...\apache-activemq-5.6.0\bin\win64>
Still in the cmd.exe, run InstellService.bat
It does not work if you run something like win64\InstellService.bat while being in bin. You have to actually navigate to bin\win64 first.
The in case you are installing in win 64 bit 2012 Server too, run InstallService.bat under sys32.
Its little confusing but it works.