Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environmental variables are not reloaded on new console #132

Closed
gsbabil opened this issue Jan 31, 2014 · 7 comments
Closed

Environmental variables are not reloaded on new console #132

gsbabil opened this issue Jan 31, 2014 · 7 comments

Comments

@gsbabil
Copy link

gsbabil commented Jan 31, 2014

Cmder version: 1.1.3
Windows version: 8.1 (64bit)

To reproduce:

  • Run Cmder (it creates the first console). Add a user environmental variable (e.g. TEST=1234)
  • Create a new console inside the same Cmder session and run echo %TEST%. It will print %TEST% meaning the variable doesn't exist
  • Restart the whole Cmder session (kill and start over). Now run echo %TEST%. It will print 1234 meaning that the %TEST% variable exists for the session this time.
@samvasko
Copy link
Contributor

I am not sure if you used setx or set so I will check both:

With set after I restart the cmder. I don't get 1234 echoed. I am pretty sure variables set by set name=value are tied to lifetime of cmd session.

If you are using setx than the environmental vars first need to be reloaded on the second console to work. If you want this kind of functionality you should try some for this.

@gsbabil
Copy link
Author

gsbabil commented Jan 31, 2014

I didn't use either of set or setx. I added my variable using Windows' built-in tool. In Windows 8.1, it is in Control Panel > System and Security > System > Advanced System Settings > Environmental Variables. Alternatively, one can just search for Environmental Variables in Windows' search to reach there.

capture

@sc0tt
Copy link
Contributor

sc0tt commented Jan 31, 2014

This is from ConEmu, I'd suggest taking the issue up on that issue tracker.

@samvasko
Copy link
Contributor

But has been a default since forever. Env variables get loaded on start of cmd.exe

@gsbabil
Copy link
Author

gsbabil commented Feb 1, 2014

@Bliker You are right. I was guessing that Cmder might create multiple cmd.exe session as new consoles are created. If not, the ConEmu initialization script that runs at the beginning of every new console session might add something that reloads all the environmental variables.

@samvasko samvasko closed this as completed Feb 1, 2014
@Chigogo
Copy link

Chigogo commented Apr 16, 2018

@samvasko I use setx both in CMD and Cmder, I get that whether I start a new console in current session or I restart Cmder session, the result is the same that Cmder wont refreash user-level's variable.

@joeflack4
Copy link

Restarting Windows10 fixed for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants