You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature or problem you’d like to solve
When running the completion sub-command, gh cli will check for updates and write a message if an update is available (this was suggested in #85). The expected use is to eval this command in your .bashrc or .anything_rc, this means that a information message will be written every time a prompt is opened.
While I think this feature is useful (this tool is not part of most distributions official repositories yet), I also think that it can be considered to be quite annoying and intrusive. If you installed this from a repository, this also means that you might get pointless messages for a few days until your package gets updated, this might become a very common scenario in the future.
Proposed solution
It would be nice to have a feature switch in parameters (-q, --quiet for example?) to disable update notifications. Currently no such option seem to exist:
>> gh completion -h
Generate shell completion scripts for GitHub CLI commands.
For example, for bash you could add this to your '~/.bash_profile':
eval "$(gh completion)"
When installing GitHub CLI through a package manager, however, it's possible that
no additional shell configuration is necessary to gain completion support. For
Homebrew, see <https://docs.brew.sh/Shell-Completion>
Usage:
gh completion [flags]
Flags:
-s, --shell string Shell type: {bash|zsh|fish|powershell} (default "bash")
Global Flags:
--help Show help for command
-R, --repo OWNER/REPO Select another repository using the OWNER/REPO format
It's a good point that upgrade check + notifications definitely should not run during gh completion for the reason you stated. I will open a separate issue labeled "bug" for that.
I also agree that there should be a documented way to disable upgrade notifications. 👍
I propose: GH_NO_UPDATE_NOTIFIER=1 (or any value) disables checking for updates.
@samcoe I don't think we need to add a config file setting for this just yet. Let's see if people ask for it after they already have the environment setting.
Furthermore, I believe that we shouldn't check for updates in CI/CD environments at all. We can detect these environments by checking if any of these environment variables is set to a non-blank value: CI, BUILD_NUMBER, RUN_ID.
Activity
[-]Add a option to hide update notifications[/-][+]Add a option to disable update notifications[/+]mislav commentedon Apr 3, 2020
Thank you for a great feature request!
It's a good point that upgrade check + notifications definitely should not run during
gh completionfor the reason you stated. I will open a separate issue labeled "bug" for that.I also agree that there should be a documented way to disable upgrade notifications. 👍
mike-burns commentedon Oct 6, 2020
Back in #99 (review) @mislav suggested
Is that idea still on the table?
mislav commentedon Oct 7, 2020
@mike-burns Yes the idea is still on the table!
I propose:
GH_NO_UPDATE_NOTIFIER=1(or any value) disables checking for updates.@samcoe I don't think we need to add a config file setting for this just yet. Let's see if people ask for it after they already have the environment setting.
Furthermore, I believe that we shouldn't check for updates in CI/CD environments at all. We can detect these environments by checking if any of these environment variables is set to a non-blank value:
CI,BUILD_NUMBER,RUN_ID.