Cmder: `cd/d D:` always goes to `D:\Programs\Cmder\config\profile.d`

Created on 11 Mar 2017  ·  3Comments  ·  Source: cmderdev/cmder

As I put Cmder at D:\Programs\Cmder, every time when I change directory by:
~ shell
D:
cd/d D:
cmder /single "D:"
~

It will goes to D:\Programs\Cmder\config\profile.d actually.
default
And I've noticed something like below (the C: goes to %HOME% is the same as Windows's Cmd):
default

  • Given path with / means the absolute path, it's obvious.
  • Without /, it seems like it will goes to the HOME folder but I'm not sure.

Any explanation?

Most helpful comment

More details I've found these days.

  • Windows' Cmd will remember the last directory of the disk you've worked at, and when you cd back to the same disk (without /), it will be there.
    image
  • Same behavior will be seen on Cmder, so we could conclude this:
    Cmder's last working directory is %CMDER_ROOT%/config/profile.d, which means Cmder runs cmd.exe at this path, and then goes to the real destination, e.g. %HOME%.
    If the target path's disk is the same as %CMDER_ROOT%'s, it's no problem.

So, if you want to make a change, go set some init scripts to cd to the root of this disk. ;-)
~ cmd
:: %CMDER_ROOT%configuser-profile.cmd
set "init_current_path=%cd%"
cd /d D:/
cd /d %init_current_path%
set init_current_path=
~

But it will not change cmder /single "D:"'s behavior.


*.{bat|cmd}s at %CMDER_ROOT%/config/profile.d are going to be init scripts, where we may know the reason for it becomes the last path Cmder worked at before program getting ready.

All 3 comments

Getting same issue. Fairly new to using cli so I am not sure what to do

More details I've found these days.

  • Windows' Cmd will remember the last directory of the disk you've worked at, and when you cd back to the same disk (without /), it will be there.
    image
  • Same behavior will be seen on Cmder, so we could conclude this:
    Cmder's last working directory is %CMDER_ROOT%/config/profile.d, which means Cmder runs cmd.exe at this path, and then goes to the real destination, e.g. %HOME%.
    If the target path's disk is the same as %CMDER_ROOT%'s, it's no problem.

So, if you want to make a change, go set some init scripts to cd to the root of this disk. ;-)
~ cmd
:: %CMDER_ROOT%configuser-profile.cmd
set "init_current_path=%cd%"
cd /d D:/
cd /d %init_current_path%
set init_current_path=
~

But it will not change cmder /single "D:"'s behavior.


*.{bat|cmd}s at %CMDER_ROOT%/config/profile.d are going to be init scripts, where we may know the reason for it becomes the last path Cmder worked at before program getting ready.

file user_aliases.cmd, add new line:
D:=cd /d D:/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zsedcbm picture zsedcbm  ·  3Comments

brunowego picture brunowego  ·  3Comments

jordanrobinson picture jordanrobinson  ·  3Comments

emesx picture emesx  ·  3Comments

GlassGruber picture GlassGruber  ·  3Comments