mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-16 22:57:49 +08:00
Make "cmder here" work again
The new system works by setting "CMDER_START" if a cmder.exe gets a startup path. The rest is then implemented in the profile.ps1 and init.bat. The new system works as follows: 1.If a startup path is given, cmder.exe sets this as `CMDER_START` and the startup scripts change to that directory. 2.If the usere sets a `CMDER_START` environment variable and this is not overwritten by cmder.exe, this variable is taken as the startup directory by the startup scripts. 3.If not such path is give, the conemu startup dirs is the winner, as the startup scripts don't change anything.
This commit is contained in:
8
vendor/init.bat
vendored
8
vendor/init.bat
vendored
@ -58,7 +58,7 @@
|
||||
@if not exist "%CMDER_ROOT%\config\aliases" (
|
||||
echo Creating intial aliases in %CMDER_ROOT%\config\aliases
|
||||
copy "%CMDER_ROOT%\vendor\aliases.example" "%CMDER_ROOT%\config\aliases" > null
|
||||
)
|
||||
)
|
||||
|
||||
:: Add aliases
|
||||
@doskey /macrofile="%CMDER_ROOT%\config\aliases"
|
||||
@ -76,12 +76,10 @@
|
||||
:: Set home path
|
||||
@if not defined HOME set HOME=%USERPROFILE%
|
||||
|
||||
:: This is either a env variable set by the user or the result of
|
||||
:: cmder.exe setting this variable due to a commandline argument or a "cmder here"
|
||||
@if defined CMDER_START (
|
||||
@cd /d "%CMDER_START%"
|
||||
) else (
|
||||
@if "%CD%\" == "%CMDER_ROOT%\" (
|
||||
@cd /d "%HOME%"
|
||||
)
|
||||
)
|
||||
|
||||
@if exist "%CMDER_ROOT%\config\user-profile.cmd" (
|
||||
|
Reference in New Issue
Block a user