question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use fresh environment block on new terminals in Windows

See original GitHub issue

At the moment, if any environment variables change, or new “apps” are installed while VS Code is running, in order for those changes to be recognized VS Code needs to be closed and re-open.

For instance, when running npm i -g <something> or choco install <package> in another prompt or powershell window, those new commands are not recognized until the app is rebooted.

It would be great if adding a new terminal instance with + would load these new variables/apps/notsurewhatterminologytouse.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:87
  • Comments:41 (8 by maintainers)

github_iconTop GitHub Comments

33reactions
MirzaSikandercommented, Apr 19, 2018

Okay so I think I found two different issues.

  • You do need to kill all instances to refresh environment variables. This is easy to repro.
  1. Start 2 vscode instances pointing to different directories.
  2. Add a new env variable through System Properties > Environement variables called TEST
  3. Check $env:TEST in both instances. Result: Not updated.
  4. Restart one instance by killing it and then using Open folder to open the directory. Check again. Result: Not updated.
  5. Restart both instances by killing both and using Open folder. Check again. Result: Updated.
  • The second issue is that if you open your workspaces using links under Recent, you will find that even after restarting VSCode, the environment variables are not updated.
  1. Start one instance.
  2. Update env variable.
  3. Kill instance.
  4. Open VScode by right clicking on Task bar and selecting the folder from Recent Workspaces
  5. Check env variable. Result: Not updated.
12reactions
edwin-hendrikscommented, Mar 14, 2019

I am a teacher on the Radboud University in the Netherlands and my students have a lot of problems with this issue. Most work on Windows 10 and for them the easiest work around is to restart their computers. Because this is counter intuitive, it often takes them a while to figure out how to solve it. So fixing this issue would be a great help to me and my students.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmd - Is there a command to refresh environment variables ...
The terminal I set the path could see the new Path variable already (in Windows 7). taskkill /f /im explorer.exe && explorer.exe. Share....
Read more >
Introducing Windows Terminal - Windows Command Line
Windows Terminal is a new, modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells ...
Read more >
Windows Terminal adds advanced tab ... - Bleeping Computer
To use the new tab switcher for switching to the next and previous ... spawned under Terminal will be given a fresh new...
Read more >
Environment Variables - Foundry Learn
On Windows · 1. Right-click on My Computer and select Properties. · 2. Go to the Advanced tab. · 3. Click the Environment...
Read more >
Chapter 2 - Environment Setup and the Command Line
For one, setting up your environment often requires you to use the command line rather than the graphical windows. For another, entering commands...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found