21

I thought maybe it was a system issue but recently did a fresh install (win7 64bit) and a clean install of conemu (had same problem with both conemu and console2 on old win32 system). Also everything I find researching has to do with adding variables via the command line. I'm doing this through Start->Control Panel->System->Advanced System Settings and then restarting the console. cmd picks up the path correctly.

When I manually add a new path to the system or user PATH variable and then restart the console and echo %path% it has not re-loaded the new PATH variable.

cmd.exe:

C:\Users\lotus>echo %path%
C:\Python33\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\
System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\PHP;C:\ProgramData\
Composer\bin;C:\PHP;C:\PHP\ext;C:\Ruby200-x64\bin;C:\Users\lotus\AppData\Roaming
\npm

conemu:

C:\Program Files\ConEmu>echo %path%
C:\Program Files\ConEmu\ConEmu;C:\Program Files\ConEmu;C:\Python33\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Ruby200-x64\bin

I know there is a extra C:\PHP but that's another issue. I still have the same problem if I remove that.

Thanks

isimmons
  • 2,016
  • 2
  • 20
  • 32

2 Answers2

29

When you are using alternative tab based terminals like ConEmu or Console2, you need to restart the terminal, not a single console (read tab)!

This is because child processes inherit their environment their direct parent process, not from the system!

Sometimes explorer (or whatever shell you are using to start ConEmu) needs to be restarted, as in you have to kill explorer.exe, so your start menu disappears and relaunch it from task manager. If all else fails, log off and on again.

Justin Dearing
  • 14,270
  • 22
  • 88
  • 161
Maximus
  • 10,751
  • 8
  • 47
  • 65
  • "When you are using alternative terminals like ConEmu or Console2, you need to restart not a console (read tab), but while terminal!" Not sure what you mean by this. I closed conemu completely and then reopen it. I also tried restarting explorer via task manager and that didn't work. But logging off and back on works. It's slightly irritating to have to do but saves a system restart. – isimmons Jun 11 '13 at 18:24
  • I've never seen that personally, and can't understand how that may happens... Seems like Explorer or OS bug. I've write about restating the whole terminal, because you have not said that "conemu was closed and restarted again". – Maximus Jun 11 '13 at 22:14
  • Oh ok yeah I completely closed it. Maybe researching what all shuts down on a logoff (explorer.exe, dwm.exe, winlogon.exe?, etc.) I can figure out if there is a way to do it without actually logging off. But if not, it's not a big deal to log off. Thanks – isimmons Jun 12 '13 at 00:37
  • 1
    This works too :-) http://stackoverflow.com/questions/171588/is-there-a-command-to-refresh-environment-variables-from-the-command-prompt-in-w – isimmons Jun 12 '13 at 01:27
  • 1
    I was opening comemu from a "explorer" window (there was no comemu process). Only got the new path after closing the explorer window. – Ricardo Rivaldo Oct 08 '14 at 14:00
  • @RicardoRivaldo Do you understand what is the inheritance? ConEmu **always** inherits all environment from the parent process. If the parent has "wrong" environment neither child process (e.g. ConEmu) can gets "right" one. – Maximus Oct 08 '14 at 21:05
  • @Maximus Yes, but this is only with comemu. Windows command prompt (regular windows console) does not have this incorrect behavior. You change the environment and the next console will always get the new config. – Ricardo Rivaldo Oct 09 '14 at 13:11
  • It's hard to believe. May be you are running them different ways. – Maximus Oct 09 '14 at 16:54
  • @isimmons Even if you close all the tabs and comemu closes, it might not be completely closed, it might have started in the background when the pc started so is always there unless you end task it from TaskManager. – phazei Dec 04 '14 at 07:48
  • Even it is "there" you do not need to use TaskManager. ConEmu icon must be in the taskbar status area (TSA). – Maximus Dec 04 '14 at 11:17
3

Even if ConEmu is closed, there is a ConEmu64.exe process. Need to kill it.

Der_Meister
  • 4,771
  • 2
  • 46
  • 53
  • That may be if user have chosen to minimize (or hide to the notification area) the GUI (main ConEmu window) instead of terminate it. – Maximus Oct 08 '14 at 21:08