mirror of
https://github.com/cmderdev/cmder.git
synced 2025-09-16 19:23:13 +08:00
Enhance cmder start directory.
The start directory of cmder is defined in that order: 1. The directory passed as parameter to the cmder executable 2. The `CMDER_START` environment variable 3. The `HOME` environment variable 4. The current user directory (`USERPROFILE` environment variable) This commit also fix two issues: * stating cmder with a path in parameter would set CMDER_START (whereas it may just be temporary) * fix new line in cmd when starting cmder (this one was buggin me)
This commit is contained in:
8
vendor/init.bat
vendored
8
vendor/init.bat
vendored
@ -37,12 +37,4 @@
|
||||
:: Set home path
|
||||
@if not defined HOME set HOME=%USERPROFILE%
|
||||
|
||||
@if defined CMDER_START (
|
||||
@cd /d "%CMDER_START%"
|
||||
) else (
|
||||
@if "%CD%\" == "%CMDER_ROOT%" (
|
||||
@cd /d "%HOME%"
|
||||
)
|
||||
)
|
||||
|
||||
:: @call "%CMDER_ROOT%/bin/agent.cmd"
|
||||
|
7
vendor/profile.ps1
vendored
7
vendor/profile.ps1
vendored
@ -30,10 +30,3 @@ if (Get-Module posh-git) {
|
||||
Enable-GitColors
|
||||
Start-SshAgent -Quiet
|
||||
}
|
||||
|
||||
# Move to the wanted location
|
||||
if (Test-Path Env:\CMDER_START) {
|
||||
Set-Location -Path $Env:CMDER_START
|
||||
} elseif ($Env:CMDER_ROOT -and $Env:CMDER_ROOT.StartsWith($pwd)) {
|
||||
Set-Location -Path $Env:USERPROFILE
|
||||
}
|
||||
|
Reference in New Issue
Block a user