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

[patch] Fix issue where zsh global aliases break nvm help #3394

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

AllySummers
Copy link
Contributor

Fix issue with the color codes in the nvm help text where short shell aliases would display an inline error in the nvm help text.

Given a zsh alias such as:

alias -g C='| clipcopy'

This would cause an issue with the nvm --help text, where the colour code function would have an unquoted 'C' and therefore print an error to the console and silently continue. I have attached a screenshot of what it looks like with this update and what it looks like before

Screenshot 2024-07-26 at 4 30 52 AM Screenshot 2024-07-26 at 4 32 54 AM

Fix issue with the color codes in the nvm help text where zsh global aliases would display an inline error in the nvm help text.
@ljharb
Copy link
Member

ljharb commented Jul 26, 2024

this is a fine change, but to be clear it's not "short" aliases, it's only zsh's global aliases which do this (and are a very bad idea as a result).

@ljharb ljharb added shell: zsh shell alias clobbering Anything dealing with users shadowing builtins with aliases or functions. labels Jul 26, 2024
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but it'd be really nice to have a zsh-only regression test to check for this.

@AllySummers
Copy link
Contributor Author

I'll see if I can do that maybe over the weekend or early to mid next week!

If I have forgotten, you're welcome to ping me.

Thanks for the quick review!

@ljharb
Copy link
Member

ljharb commented Jul 26, 2024

@AllySummers i'm going to merge this shortly, and I would really appreciate a follow-up PR to add a test for zsh global aliases :-)

@ljharb ljharb changed the title [patch]: Fix issue where short shell aliases would break nvm help [patch] Fix issue where zsh global aliases break nvm help Jul 26, 2024
@ljharb ljharb merged commit dd89af5 into nvm-sh:master Jul 26, 2024
110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shell alias clobbering Anything dealing with users shadowing builtins with aliases or functions. shell: zsh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants