3

1. Summary

Values of PATH user environment variable don't refresh for me, if I work in ConEmu. I need to restart Windows.

2. Expected behavior

I use Chocolatey refreshenv script. If I run refreshenv in Hyper terminal or Clink:

C:\Users\SashaChernykh>zeal
'zeal' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\SashaChernykh>refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait…Finished..

C:\Users\SashaChernykh>zeal

Zeal successful run for me.

3. Actual behavior

In ConEmu:

C:\Program Files\Far Manager>zeal
'zeal' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Far Manager>refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait…Finished..

C:\Program Files\Far Manager>zeal
'zeal' is not recognized as an internal or external command,
operable program or batch file.

4. Steps to reproduce

I download Zeal program via Chocolatey → I add C:\Program Files (x86)\Zeal —— path to zeal.exe in my User environment variable via Rapid Environment Editor:

RapidEE

Ctrl+S.

I get expected behavior for Clink and Hyper and actual behavior for ConEmu.

5. Not helped

  1. Refreshenv Chocolatey script,
  2. explorer.exe restart,
  3. Close all windows and tabs of all my terminals,
  4. resetvars.vbs script,
  5. ConEmuC /export PATH.

6. Do not offer

  1. Please, do not offer restart Windows. It takes a lot of time.

7. Environment

Operating system and version:
Windows 10 Enterprise LTSB 64-bit EN
ConEmu:
170118 [64]
{Far} mode

1
6

For me its OK just if I close all conemu.exe or conemu64.exe (or even conhost.exe or cmd.exe if any, but they shouldn't affect ConEmu) processes and then just start ConEmu, take a look:

But note one important thing:

If you start ConEmu(or any other program) from another program like launcher or by hot-key created by another program or even by mouse gesture(using something like Strokes Plus) you need to restart that program to make that program to receive new environment variables/values, which will be given to child programs, you can see which are child processes and which are parent ones in program like Process Explorer or Process Hacker. So in order to child receive right environment variables/values you need to restart its parent(if you call child from parent).

5
  • Blade Might, thanks for answer! 2 questions. 1) Why in ConEmu don't work refreshenv command like other terminals? Is any way, that it works? 2) Your method don't work for me, if I run ConEmu via ConEmu Sublime Text package. I run ConEmu via Sublime Text package → I change my environment variable use setx → I close ConEmu and Sublime Text → I run ConEmu via Sublime Text package → environment variable don't change for me. Thanks. Mar 15 '17 at 6:24
  • 1) It actually works for me... 2) Following exactly what you said it works for me too... Maybe your Sublime Text(or ConEmu) stays in memory(or tray), or something like that?
    – BladeMight
    Mar 15 '17 at 10:16
  • Maybe your Sublime Text(or ConEmu) stays in memory(or tray), or something like that? — I check — I don't have Sublime Text and ConEmu process, if I reproduce the problem. // You use ConEmu in Far mode? Mar 15 '17 at 10:21
  • You use ConEmu in Far mode? Yes and No. But in gif above - No. 1) Here how refresh env works for me: uploads.ru/sx1jE.gif Script i used: github.com/chocolatey/chocolatey/blob/master/src/redirects/…
    – BladeMight
    Mar 15 '17 at 10:44
  • 1
    I use Autohotkey to start cmder (which is a wrapper of ConEmu) and met the same problem. The solution is quit the ahk script and start it again. Now the %PATH% variable is updated.
    – Leo
    Jul 18 '17 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.