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

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

Closed
hyrious opened this issue Mar 11, 2017 · 3 comments
Closed

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

hyrious opened this issue Mar 11, 2017 · 3 comments

Comments

@hyrious
Copy link

hyrious commented Mar 11, 2017

As I put Cmder at D:\Programs\Cmder, every time when I change directory by:

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?

@manizm
Copy link

manizm commented Mar 16, 2017

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

@hyrious
Copy link
Author

hyrious commented Mar 17, 2017

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. ;-)

:: %CMDER_ROOT%\config\user-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.

@hyrious hyrious closed this as completed Apr 20, 2017
@azhe93
Copy link

azhe93 commented Sep 21, 2020

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

@hyrious hyrious changed the title cd/d D:' always goes to D:\Programs\Cmder\config\profile.d' cd/d D: always goes to D:\Programs\Cmder\config\profile.d Sep 21, 2020
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