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

[v1.2.9] Can not alias with env. variables. #784

Closed
esphas opened this issue Jan 2, 2016 · 2 comments
Closed

[v1.2.9] Can not alias with env. variables. #784

esphas opened this issue Jan 2, 2016 · 2 comments

Comments

@esphas
Copy link

esphas commented Jan 2, 2016

Env. variables in config\aliases will not work - they just display as is. But do alias in cmder works.
In config\aliases:

ppath=echo %PATH%

In cmder:

λ ppath
%PATH%
λ echo %PATH%
C:\WINDOWS\System32\...
λ alias ppath=echo %PATH%
λ ppath
C:\WINDOWS\System32\...

And, er..
In cmd:

> set CMDER_ROOT=e:\uts\cmder
> cd bin
> alias.bat /reload
Aliases reloaded
> ppath
C:\WINDOWS\System32\...

It might be related to the strange behavior of doskey:
In cmder:

λ doskey /macrofile=e:\uts\cmder\config\aliases
λ ppath
%PATH%

In cmd:

> doskey /macrofile=e:\uts\cmder\config\aliases
> ppath
C:\WINDOWS\System32\...

Edit:
Well, I found it reasonable why alias directly in cmder can use env. variables because the bin\alias.bat just got the real PATH as an argument instead of the string "%PATH%" - it just stored the value in config\aliases when exactly running.

But I still don't understand the problem itself - why doskey works wrong with cmder.

@okaufmann
Copy link

same problem here

@esphas
Copy link
Author

esphas commented Jan 6, 2016

I found another issue reports the same problem: #684

It seems the dev build of clink can be used as a temporary fix. Anyway I thought this issue can be closed?

@esphas esphas closed this as completed Jan 6, 2016
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

2 participants