conemu and console2 emulators not getting new path variable

我只是一个虾纸丫 提交于 2021-02-06 09:49:12

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/17030666/conemu-and-console2-emulators-not-getting-new-path-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!