Closed DrissBoumlik closed 9 months ago
No idea what you are talking about. Can you clarify?
Chocolatey is a way to install Cmder. We have nothing to do with it.
What does 'I installed chocolatey in order to refresh the env variables without restarting cmder' mean?
What is RefreshEnv
?
What does 'is there a way to reload linux command' mean?
I think it's referring to this: https://docs.chocolatey.org/en-us/create/functions/update-sessionenvironment
PowerShell and Chocolatey don't know about Cmder or the scripts Cmder runs to initialize environment variables, so refreshenv doesn't re-initialize Cmder.
I think the OP wants to know what additional step to run after refreshenv, to re-initialize the Cmder environment variables (especially the changes to PATH). And if the PATH is getting set up by ConEmu, then it might be more complicated to refresh than just running a script.
In my case I want to edit the PATH variable without restarting the terminal (cmder), so when after searching, I found that it can be done by running RefreshEnv
which is a chocolatey command line to reload the PATH changes,
so here is what I do
I run setx /m PATH New_Value
and then refreshenv
(requires cmder to be run with admin rights)
this works fine but when I run alias
or touch
it shows that the command is not recognized as an internal or external command ...
so yes what @chrisant996 said is pretty much what I'm asking, I want to know how cmder loads or recognizes the linux commands or simply how I can make it loads the updates I made in the environment variables (is this case PATH)
To my knowledge what you are asking cannot be done without a restart of ConEmu. ConEmu is the terminal emulator.
You could ask the developer of ConEmu.
That could have undesired effects though since Cmder init.bat modifies the path known to ConEmu so you might not thet the results you expect.
Possibly a refreshenv then an init.bat might do the trick.
Hi just in case someone has same issue
The solution I found for now is to add Cmder\vendor\git-for-windows\usr\bin
(where linux commands are loaded) & Cmder\vendor\bin
(where alias.cmd exists) to the Path variable.
Question
Hello Cmder Team
I installed chocolatey in order to refresh the env variables without restarting cmder and the issue is when I run
RefreshEnv
I can no longer run linux commands such asalias
,ls
,touch
... etc Message I get'ls' is not recognized as an internal or external command, operable program or batch file.
is there a way to reload linux command, I tried running
%CMDER_ROOT%\vendor\init.bat
but nothing changed. the idea is to stay in the current cmder. Can you help with this pleaseThank you
Checklist