Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Incorrect startup directory. #571

Closed
kermage opened this issue Aug 1, 2015 · 1 comment
Closed

FIX: Incorrect startup directory. #571

kermage opened this issue Aug 1, 2015 · 1 comment

Comments

@kermage
Copy link

kermage commented Aug 1, 2015

Creating a new console/tab defaults to the directory where the Cmder is started, NOT to desired directory set in Startup directory for new process:

Example:

  • Start Cmder in C:\Custom-Dir
  • Then create a new process/tab
  • Set the startup dir to C:\Another-Dir

New tab opens in C:\Custom-Dir which is the first Cmder startup directory, where it should be in C:\Another-Dir or whatever is set in the new console creation

_I don't know if this is Cmder bug, or maybe i just broke something that cause this._
Found that this is not getting through #L115.
--causing the initialization scripts to fail (not moving to the wanted location).

Anyway, if anyone else having this said issue, here's how I fix it:
Here's my quick fix:

  • Comment out these lines in %CMDER_ROOT%\vendor\init.bat with ::
@if defined CMDER_START (
    @cd /d "%CMDER_START%"
) else (
    @if "%CD%\" == "%CMDER_ROOT%" (
        @cd /d "%HOME%"
    )
)
  • Edit the default predefined task {cmd} in (Settings > Startup > Tasks) to
cmd /k "%ConEmuDir%\..\init.bat" -new_console:C:"%CMDER_ROOT%\cmder.exe"

Update: Also for Powershell

  • Comment out these lines in %CMDER_ROOT%\vendor\profile.ps1 with #
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
}
  • Edit the default predefined task {Powershell} in (Settings > Startup > Tasks) to
PowerShell -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''"
@w3cay
Copy link

w3cay commented Aug 15, 2015

Thank you !

@MartiUK MartiUK closed this as completed Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants