pure: Cannot add pure to prompt themes, connected to MB M1?

General information

I’m using the pure theme now for two years without any issues. Yesterday I switched to a new MacBook Air M1 and now I’m having some issues. I cannot set the prompt to pure with prompt pure.

System report (output of prompt_pure_system_report):

zsh: command not found: prompt_pure_system_report

Other information

I have:

  • Tested with another terminal program and can reproduce the issue: iTerm
  • Followed the integration instructions for my framework

Problem description

When I try to add the theme with prompt pure:

Result:

Usage: prompt <options>
Options:
    -c              Show currently selected theme and parameters
    -l              List currently available prompt themes
    -p [<themes>]   Preview given themes (defaults to all)
    -h [<theme>]    Display help (for given theme)
    -s <theme>      Set and save theme
    <theme>         Switch to new theme immediately (changes not saved)

Use prompt -h <theme> for help on specific themes.

When I show the list of available themes with prompt -l, pure is not in this list. I have installed it, like the years before, with npm install --global pure-prompt.

I’m not sure what the problem is. Could it be connected to the M1 MacBook?

Reproduction steps

  1. MacBook Air M1
  2. Install pure through npm global
  3. Try to set the theme with the code below from my .zshrc file.

My .zshrc:

# Activate Oh-My-Zsh
source $ZSH/oh-my-zsh.sh

# Change Pure Colors
zmodload zsh/nearcolor
zstyle :prompt:pure:git:branch color green

# Activate Pure Theme
# Make sure to remove this if you use another theme
autoload -U promptinit; promptinit
prompt  pure

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 29
  • Comments: 31

Commits related to this issue

Most upvoted comments

Thank you @diogotorres97, however you missed the “s” in your answer:

# .zshrc

fpath+=/opt/homebrew/share/zsh/site-functions

autoload -U promptinit; promptinit
prompt pure

Now Pure (installed with Homebrew) is working on my MacBook Air M1 with macOS Monterey.

I also tried the manual way, like described:

mkdir -p "$HOME/.zsh"
git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure"

# .zshrc
fpath+=$HOME/.zsh/pure

Thanks!! This works perfectly!

I’ve gotten so used to pure I can’t handle the standard prompt…

same problem

Same problem here, on MacBook Air M1.

I added fpath+=/opt/homebrew/share/zsh/site-functions to the .zshrc (installed via homebrew)

I also tried the manual way, like described:

mkdir -p "$HOME/.zsh"
git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure"

# .zshrc
fpath+=$HOME/.zsh/pure

Unfortunately, pure theme still not in the prompt list.

Ok I take the last message, back. Setting it up manually, worked after autoload -U promptinit; promptinit. So it seems the issue is only connected to the global prompt npm package in my case.

Just installed Pure via Homebrew on an M1 iMac and I’m having the same issue. I can work around it, but it would nice if Pure could be updated to handle the new Homebrew paths.

Oh you are right, on my other laptop the path is still usr/local/homwbrew. Thanks for the hint.

The path changed on M1 laptops: https://www.reddit.com/r/MacOS/comments/jw9guu/why_did_homebrew_move_from_usrlocalto_opthomebrew/

Do you think this is something your package could check on install?

I’d also like to point out that another option is to change the Homebrew provided Zsh, FWIW.

brew install zsh
echo /opt/homebrew/bin/zsh | sudo tee -a /etc/shells
chsh -s /opt/homebrew/bin/zsh

Could someone with an M1 Mac test #606 to see if it works? You can clone the repo and then run npm run postinstall inside it (notice that it should create symlinks in /opt/homebrew/share/zsh/site-functions, so don’t let that mess up your setup).

@adamgruber that’s expected when you haven’t installed (or aren’t using) ZSH from Homebrew. We don’t have write permissions to that path. The manual add of fpath is the fix.