Open Frostymnl opened 3 years ago
@dmccaffery this is the install output that Ross had shared with me.
It looks to me like the platform install script wasn't called which would set the completions, git prompt, etc based on the lack of prompt arrow after attempting to install.
Also I suggested trying the next
release, but he couldn't get it to work because of the ...cannot retrieve SHA
error. Could this have to do with hitting the GitHub API too frequently?
prompt: using bash shell
prompt: a new version of prompt is available: a95f87e6bdba2404804fb3ba30396805c1b41102
- run the update-prompt command line tool to upgrade
-bash: /Users/ross/.am/prompt/bash/completions/*: No such file or directory
-bash: __posh_git_ps1: command not found
am-mbp-142:~ ross$ update-prompt
prompt: establishing sudo (you may be prompted for credentials)...
Password:
prompt-install: creating backup path: /Users/ross/.am/backup/prompt/20210114_113908
prompt-install: backing up bash_profile
prompt-install: backing up bashrc
prompt-install: backing up profile
prompt-install: backing up zprofile
prompt-install: backing up zshrc
prompt-install: backing up /Users/ross/.am/prompt
prompt-install: removing /Users/ross/.am/prompt
prompt-install: creating /Users/ross/.am/prompt
prompt-install: installing promptMastermind to /Users/ross/.am/prompt
prompt-install: installing platform prerequisites (darwin.sh)
##############################################################################
INSTALLING VIA HOMEBREW FOR INTEL MACS
##############################################################################
installing homebrew...
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> /usr/bin/sudo /usr/sbin/chown ross:admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
HEAD is now at e989a0fb0 Merge pull request #10327 from MikeMcQuaid/keg-fix-alias-handling
Updated 2 taps (homebrew/core and homebrew/services).
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh
HOMEBREW_VERSION: 2.7.4-17-ge989a0f
ORIGIN: https://github.com/Homebrew/brew
HEAD: e989a0fb011e0f2f8b61cd195c4703c71a4b4b7f
Last commit: 3 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 20f54d5c5f560836d4a39dbafb21a0a1f30ab44e
Core tap last commit: 15 seconds ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.u7evAZXDp9/org.macosforge.xquartz:0
HOMEBREW_EDITOR: code --wait
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: octa-core 64-bit kabylake
Clang: 11.0 build 1100
Git: 2.30.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_172
macOS: 10.15.7-x86_64
CLT: 11.0.33.12
Xcode: 12.3
XQuartz: 2.7.11 => /opt/X11
updating homebrew...
Already up-to-date.
upgrading: openssl...
upgrading: git...
To relink:
brew unlink git && brew link git
upgrading: go...
To relink:
brew unlink go && brew link go
upgrading: nvm...
To relink:
brew unlink nvm && brew link nvm
upgrading: python...
To relink:
brew unlink python@3.9 && brew link python@3.9
upgrading: gpg...
To relink:
brew unlink gnupg && brew link gnupg
upgrading: pinentry-mac...
To relink:
brew unlink pinentry-mac && brew link pinentry-mac
setting up nvm...
Installing latest LTS version.
Now using node v14.15.4 (npm v6.14.10)
setting git credential helper to use the macOS keychain
prompt-install: downloading better git-prompt
upgrading: bash...
To relink:
brew unlink bash && brew link bash
upgrading: bash-completion...
To relink:
brew unlink bash-completion && brew link bash-completion
##############################################################################
##############################################################################
# $SHELL will be /usr/local/bin/bash
PLEASE RUN: exec -l $SHELL
##############################################################################
##############################################################################
open-url: opening https://github.com/automotivemastermind/prompt/blob/v8.2.0/CHANGELOG.md via open...
-bash: __posh_git_ps1: command not found
am-mbp-142:~ ross$ exec -l $SHELL
prompt: using bash shell
prompt: a new version of prompt is available: a95f87e6bdba2404804fb3ba30396805c1b41102
- run the update-prompt command line tool to upgrade
bash: /Users/ross/.am/prompt/bash/completions/*: No such file or directory
bash: __posh_git_ps1: command not found
am-mbp-142:~ ross$
Please restore the latest backup from:
~/.am/backup/prompt
This is the fastest way to unblock. There seems to be issues with hitting the GitHub API too often without being authenticated. Homebrew hits GitHub quite a bit as well, but prompt (even install) should not be hitting the api that hard. I suspect something else on your system is hitting the GitHub API and you're bumping up against the anonymous limits.
Couple of things to try after restoring the backup:
Run the github-token command to set a GitHub PAT that both prompt and homebrew will use when hitting the GitHub API.
Run edit-vars and set the prompt update var to 0; this will stop prompt from checking for new versions when launching a shell.
Launch a new terminal window to ensure the above is respected; then run:
GITHUB_TOKEN=${GITHUB_TOKEN} update-prompt
Let me know how you make out. Happy to jump on a call if the issue persists.
I should note, based on the output you shared, the installer worked as expected. It called the platform install (darwin) and also installed "better git prompt" which is where the function for posh_git_ps1 comes from -- more likely, there is an issue where the better git prompt script isn't being evaluated. I'll see if I can reproduce.
Hey @dmccaffery,
I am not sure how to restore from a backup do I just copy the files from ~/.am/backup/prompt/date
to~/.am/prompt,
I am not sure where the individual files go from ~/.am/backup/prompt/date
they do not seem to have counterparts in ~/.am/prompt
Alright so this is what I did ->
~/.am/backup/prompt/date
to ~/.am/prompt
after deleting all files in ~/.am/prompt
run github-token
meant but google lead me to create an enviroment variable for HOMEBREW_GITHUB_API_TOKEN https://stackoverflow.com/questions/20130681/setting-github-api-token-for-homebrewGITHUB_TOKEN=${GITHUB_TOKEN} update-prompt
exec -l $SHELL
this still had the issue
Last login: Thu Jan 14 14:41:24 on ttys000
prompt: using bash shell
ross@am-mbp-142 : ~
==> GITHUB_TOKEN=${GITHUB_TOKEN} update-prompt
removing path: /Users/ross/.am/backup/prompt...
prompt: establishing sudo (you may be prompted for credentials)...
Password:
prompt-install: creating backup path: /Users/ross/.am/backup/prompt/20210114_145031
prompt-install: backing up bash_profile
prompt-install: backing up bashrc
prompt-install: backing up profile
prompt-install: backing up zprofile
prompt-install: backing up zshrc
prompt-install: backing up /Users/ross/.am/prompt
prompt-install: removing /Users/ross/.am/prompt
prompt-install: creating /Users/ross/.am/prompt
prompt-install: installing promptMastermind to /Users/ross/.am/prompt
prompt-install: installing platform prerequisites (darwin.sh)
##############################################################################
INSTALLING VIA HOMEBREW FOR INTEL MACS
##############################################################################
installing homebrew...
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> /usr/bin/sudo /usr/sbin/chown ross:admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
HEAD is now at edfa34064 Merge pull request #10137 from sjackman/sj/governance
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
carthage nomad spades
==> New Casks
aldente deadbeef
==> Updated Casks
abricotine ajour docker kotlin-native portfolioperformance routebuddy
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh
HOMEBREW_VERSION: 2.7.4-21-gedfa340
ORIGIN: https://github.com/Homebrew/brew
HEAD: edfa340646c85f0f6de4aa19c63517e1ec94b8c4
Last commit: 3 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: e5b6b827579cac83b617ade406d7d2b8b538a38d
Core tap last commit: 13 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.HEjahIoZwf/org.macosforge.xquartz:0
HOMEBREW_EDITOR: code --wait
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: octa-core 64-bit kabylake
Clang: 11.0 build 1100
Git: 2.30.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_172
macOS: 10.15.7-x86_64
CLT: 11.0.33.12
Xcode: 12.3
XQuartz: 2.7.11 => /opt/X11
updating homebrew...
Already up-to-date.
upgrading: openssl...
upgrading: git...
To relink:
brew unlink git && brew link git
upgrading: go...
To relink:
brew unlink go && brew link go
upgrading: nvm...
To relink:
brew unlink nvm && brew link nvm
upgrading: python...
To relink:
brew unlink python@3.9 && brew link python@3.9
upgrading: gpg...
To relink:
brew unlink gnupg && brew link gnupg
upgrading: pinentry-mac...
To relink:
brew unlink pinentry-mac && brew link pinentry-mac
setting up nvm...
Installing latest LTS version.
Now using node v14.15.4 (npm v6.14.10)
setting git credential helper to use the macOS keychain
prompt-install: downloading better git-prompt
upgrading: bash...
To relink:
brew unlink bash && brew link bash
upgrading: bash-completion...
To relink:
brew unlink bash-completion && brew link bash-completion
##############################################################################
##############################################################################
# $SHELL will be /usr/local/bin/bash
PLEASE RUN: exec -l $SHELL
##############################################################################
##############################################################################
open-url: opening https://github.com/automotivemastermind/prompt/blob/v8.2.0/CHANGELOG.md via open...
ross@am-mbp-142 : ~
==> exec -l $SHELL
prompt: using bash shell
bash: /Users/ross/.am/prompt/bash/completions/*: No such file or directory
bash: __posh_git_ps1: command not found
am-mbp-142:~ ross$
but doing step 1 seemed to make it so prompt worked so I will do step 1 again until y'all have more steps for me to try :)
FWIW, I ran into all the same behaviors as Ross minus the github SHA issue.
github-token is a prompt command that makes the token available to prompt, homebrew, terraform, etc.
I'll take a look. This must be a bash specific issue; I've been running zsh for well over a year now (it's the default on macOS these days).
Will follow up with any findings. Apologies for the issues!
@jeffreypmoran @Frostymnl @patrickserrano Is this still a problem?
@sjk07 @patrickserrano FWIW, I ran into this issue again today when setting up a fresh machine.
@jeffreypmoran -- I will work on this tonight
@jeffreypmoran when you were setting up a fresh machine did you specify zsh
when installing prompt? E.g. curl -fsSL https://git.io/am-prompt | sh -s -- zsh
@dmccaffery can you clarify if running curl -fsSL https://git.io/am-prompt | sh -s -- bash
from zsh
should work and change the default shell to bash
? I've seen a lot of users setting up new machines with that command who end up with a broken install. Usually running use-shell zsh
fixes the issue, but it's not 100% clear to me if the issue is that the wrong install command was used (so we need clearer docs) or if there's an issue in the expected behavior.
@patrickserrano I specified bash when installing
@dmccaffery have you had a chance to look into this issue yet?
@jeffreypmoran
I know what the issue is; just have not had a chance to fix. I'll work on it this weekend.
@patrickserrano
You should be able to switch between zsh and bash, or configure either or regardless of the terminal shell being used (including dash, ash, ksh, fish, etc). We have tests to validate this; but they were broken in that previous [wip] that got merged.
The new shell should be dramatically faster as it no longer relies on shell interpreters for the prompt itself; this was [wip] as there were things I was working out to fully support arm64 (Apple M1 as well as Linux on arm). Some PRs of mine that were pending in the upstream starship project (that I finally got through) were required as well.
I'll get it fully ironed out over the weekend.
After updating my prompt I get the folowing output when my terminal starts ->
The
-bash: __posh_git_ps1: command not found
appears after running any command in prompt. I also receive aprompt: cannot retrieve SHA of latest version. Are you connected to the internet?
quite a bit even though I am connected to the internet.macOS Catalina Version 10.15.7