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

Aliases with environment variables not working #684

Closed
glucas opened this issue Oct 27, 2015 · 8 comments
Closed

Aliases with environment variables not working #684

glucas opened this issue Oct 27, 2015 · 8 comments
Labels
👆 clink Upstream issue in clink. 🐛 Type: Bug
Milestone

Comments

@glucas
Copy link
Contributor

glucas commented Oct 27, 2015

I'm seeing an issue in v1.2.9 that I did not see in my previous 1.2 install. Aliases that refer to environment variables are failing. I can reproduce this with the built-in history alias:

λ history
cat: %CMDER_ROOT%\config\.history: No such file or directory
λ set CMDER_ROOT
CMDER_ROOT=C:\opt\cmder
λ cat %CMDER_ROOT%\config\.history  
... works fine ...

Note that the variable is defined and the file exists. The error message indicates that CMDER_ROOT is not set, so it looks like the cat command is not inheriting the current shell environment. I see the same thing with a number of other aliases that I have. When I switch back to my older cmder installation everything works fine.

@glucas
Copy link
Contributor Author

glucas commented Nov 3, 2015

No one else seeing this? I'm on Window 8.1 and can reproduce directly after extracting cmder.7z, with no config changes:

C:\Users\glucas
λ history
cat: %CMDER_ROOT%\config\.history: No such file or directory

C:\Users\glucas
λ cat %CMDER_ROOT%\config\.history
cat: C:\Users\glucas\cmder\config\.history: No such file or directory

C:\Users\glucas
λ touch %CMDER_ROOT%\config\.history

C:\Users\glucas
λ history
cat: %CMDER_ROOT%\config\.history: No such file or directory

@glucas
Copy link
Contributor Author

glucas commented Nov 3, 2015

Another test case. On plain old cmd.exe:

C:\>doskey tryme=echo ^%HOME^%
C:\>tryme
C:\Users\glucas

On cmder.exe:

λ ls %CMDER_ROOT% | grep Version
Version v1.2.9
λ doskey tryme=^%HOME^%
λ tryme
%HOME%

On my prior cmder.exe:

λ ls %CMDER_ROOT% | grep Version
Version v1.2
λ doskey tryme=echo ^%HOME^%
λ tryme
C:\Users\glucas

@Stanzilla
Copy link
Member

Yep, can reproduce, not yet sure what caused it though.

@glucas
Copy link
Contributor Author

glucas commented Nov 3, 2015

Thanks for confirming. This could be related to clink v0.4.4 vs v0.4.5. See for example mridgers/clink#344, which is not exactly the same but seems related.

@Stanzilla Stanzilla added this to the 1.3 milestone Nov 3, 2015
@Stanzilla
Copy link
Member

Did you test with clink 0.4.4?

Edit: Ok I did, so I can blame clink now, great!

@Stanzilla
Copy link
Member

You can use this test build of clink to have the fix right now, we will make sure to include it in our next release: https://www.dropbox.com/sh/hqbrpkf0dpmmizq/AADIJ4G5gjJ59JfFmr-3-Qc0a/20150923_1abb57/clink_DEV.zip?dl=0

Thanks for helping us find the issue and reporting it in the first place!

@Stanzilla Stanzilla added 👆 clink Upstream issue in clink. and removed 🍰 Component: Batch labels Nov 3, 2015
@glucas
Copy link
Contributor Author

glucas commented Nov 4, 2015

Yes, the the dev build of clink fixes the problem. Thanks!

@gustavohenke
Copy link

👍 Also using this dev build as a fix, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👆 clink Upstream issue in clink. 🐛 Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants