Skip to content

Commit

Permalink
Find cmder files when running as Administrator.
Browse files Browse the repository at this point in the history
When starting a shell as Administrator, the CMDER_ROOT variable is
not propagated from the parent (non-Admin) environment.
Fix this by using paths relative to %ConEmuDir%.

Fixes issue cmderdev#94.
  • Loading branch information
glucas committed Mar 13, 2014
1 parent 7688823 commit c769502
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/ConEmu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
<key name="Task1" modified="2013-11-29 16:19:41" build="131107">
<value name="Name" type="string" data="{cmd}"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="cmd /k &quot;%CMDER_ROOT%\vendor\init.bat&quot; -new_console:d:%USERPROFILE%"/>
<value name="Cmd1" type="string" data="cmd /k &quot;%ConEmuDir%\..\init.bat&quot; -new_console:d:%USERPROFILE%"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
<value name="Hotkey" type="dword" data="00000000"/>
Expand Down
5 changes: 5 additions & 0 deletions vendor/init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
:: Sets some nice defaults
:: Created as part of cmder project

:: Find root dir
@if not defined CMDER_ROOT (
for /f %%i in ("%ConEmuDir%\..\..") do @set CMDER_ROOT="%%~fi"
)

:: Change the prompt style
:: Mmm tasty lamb
@prompt $E[1;32;40m$P$S{git}$S$_$E[1;30;40m{lamb}$S$E[0m
Expand Down

0 comments on commit c769502

Please sign in to comment.