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

Aliased commands: Syntax Highlighting Lost #912

Closed
TheRealBluebird opened this issue Apr 6, 2016 · 4 comments
Closed

Aliased commands: Syntax Highlighting Lost #912

TheRealBluebird opened this issue Apr 6, 2016 · 4 comments

Comments

@TheRealBluebird
Copy link

Hi,

I can't find any mention of this in previous issues.

I created an alias: "l=ls -la" (without the quotation marks)

This a fresh install of cmder on Windows 7.

The results of executing the full command and then the alias are show below. Why is the syntax highlighting lost and how can I fix it?

untitled

@daxgames
Copy link
Member

daxgames commented Apr 6, 2016 via email

@daxgames
Copy link
Member

daxgames commented Apr 6, 2016

The hi-lighting is lost because 'ls' is aliased to 'ls --color' and
doskey will not use an alias in other aliases.

@TheRealBluebird
Copy link
Author

Thank you! @daxgames

@glucas
Copy link
Contributor

glucas commented Apr 6, 2016

A potentially useful tip here is to set an environment variable with your common options and use that in your alias variants. For example:

ls=ls %LS_COMMON% $*
ll=ls %LS_COMMON% -la $*

Then set the variable in your shell, e.g. in cmder/config/user-profile,cmd:

set LS_COMMON=--color=auto -H

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