Re:Environment Variables and Path in Windows 10
by riskable on Monday October 26, 2015 @08:38AM
(#10450955)
If you made a change to your .profile why wouldn't you just apply it?
. ~/.profile
Why logout and back in? You know which file was changed because you made the change.As someone else mentioned down below, if you just need a new login shell with your variable changes just do this:
exec /bin/bash -l
(the -l meaning, "act as if... invoked as a login shell")Also a tip if you're using KDE: You don't need to logout and back in. Just do this:
killall plasmashell
kstart plasmashell
That should apply any changes you've made to environment variables to any applications that get launched (subsequently) via KDE's usual methods (e.g. K menu or krunnner aka Alt-F2). Your running applications will remain open!
Re:Environment Variables and Path in Windows 10
by lottin on Monday October 26, 2015 @06:01AM
(#10450381)
Changing how the environment works isn't a trivial change, it would have far-reaching consequences, and every program that reads the environment would need to be patched, not only the shells and display managers.
Re:Environment Variables and Path in Windows 10
by barrkel on Monday October 26, 2015 @06:42AM
(#10450518)
If the aim is to replicate how Windows works, only the GUI shell would need to reload environment variables (i.e. the process that forks when you start programs using whatever the desktop's idiom is).
Re:Environment Variables and Path in Windows 10
by lottin on Monday October 26, 2015 @07:04AM
(#10450601)
This seems inconsistent behaviour to me. Some running processes reload the environment and others don't. Maybe in Windows they can get away with it, but that doesn't mean it's a good idea.
Re:Environment Variables and Path in Windows 10
by darklajid on Monday October 26, 2015 @08:15AM
(#10450843)
To be fair: The Windows way is kinda consistent: If the environment definition was changed, everyone gets a window message. It's just that no one but explorer.exe cares about that and reacts, as far as I'm aware (Raymond Chen had a recent article mentioning exactly this).
So, the OS tells everyone 'Hey, you totally could update your environment'. But your running instance of Skype or whatever just doesn't need to care.
Re:Environment Variables and Path in Windows 10
by zastrowm on Monday October 26, 2015 @10:39AM
(#10451726)
Raymond Chen article for anyone that is interested: http://blogs.msdn.com/b/oldnewthing/archive/2015/09/15/10641...
Re:Environment Variables and Path in Windows 10
by majkinetor on Monday October 26, 2015 @08:34AM
(#10450934)
I think that reacting to system change is opt-in.
Re:Environment Variables and Path in Windows 10
by shiro on Monday October 26, 2015 @06:52AM
(#10450556)
If I change the login setting, this usually works (yeah, I have extra layer of shell but I don't care):
$ /bin/bash -l
Environment variables in Unix isn't for changing global settings. Their effects are localized by design.
Windows gets over this problem by letting the login shell (explorer.exe) reload the environment variables in place. So, if we are to do the same thing in Linux, we might have to patch bash, zsh, and GNOME etc. to understand the environment variable change events and reload itself appropriately. I'm not sure where to start, but I believe this is the one thing that Windows did right, so I want to see it happen.