-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
command-not-found-init: match fish init behavior to *sh #20741
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this break existing usage? Or can this be done in a way that it doesn't?
I understand that this is fixing an inconsistency, but it seems like this special logic for Fish (as compared to Bash and Zsh) has lived since Fish support was added (Homebrew/homebrew-command-not-found@ebfe42a). I'm not a Fish user so I can't tell why it was done that way though.
How about this: given that $ source (brew command-not-found-init)
source: Error encountered while sourcing file ''# License: MIT'':
source: No such file or directory We update the first line of --- a/Library/Homebrew/command-not-found/handler.fish
+++ b/Library/Homebrew/command-not-found/handler.fish
@@ -1,3 +1,4 @@
+# If see this error, please update your config.fish following https://docs.brew.sh/Command-Not-Found
# License: MIT
# The license text can be found in Library/Homebrew/command-not-found/LICENSE
... and update the documentation accordingly (or not, because the documented way still works), so that people relying on the existing behaviour can migrate without confusion: $ source (brew command-not-found-init)
source: Error encountered while sourcing file ''# If see this error, please update your config.fish following https://docs.brew.sh/Command-Not-Found'':
source: No such file or directory |
Anyone using the old `. (brew command-not-found-init)` formulation will see this: ``` > . (brew command-not-found-init) .: Error encountered while sourcing file ''# See https://docs.brew.sh/Command-Not-Found for current setup instructions'': .: No such file or directory ```
Thanks for the suggestion, @ZhongRuoyu! Users of the old formulation will now see this instead:
|
Thanks @gromgit! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Addresses #20740.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?