How to fix Starship cross-shell prompt not appearing on macOS

184 words, 1 minutes.


I may have ‘retired’ from being a techie a long time ago, but I haven’t stopped solving little day-to-day problems in a shell 😊 So like any self-respecting nerd, whether old or young, one needs a good prompt. It’s a pity that Starship’s setup on macOS seems to fail out of the box though. Here’s how to fix it.

Starship is a fast, configurable, prompt for most of the common shells. It’s a binary, built in Rust. Compared to the popular Oh My Zsh, it’s tiny, simple and fast. Just the way I prefer my tech.

But the instructions for configuring in zsh fail on macOS, with the prompt never appearing. It didn’t really make sense, either, as a common eval $(blah) should work just fine. Searching only throws up a Stackoverflow article that doesn’t actually solve the problem.

Rummaging through the closed issues on Github turned up the answer though; quote the eval, et voila! Working prompt.

Change eval $(starship init zsh) to eval "$(starship init zsh)" and it works.

Ah, it looks like the instructions have been updated on the homepage now.