Live data from Hacker News

Starship: A minimal, fast, and customizable prompt for any shell

starship.rs

11–20 of 216 posts

Re: Starship: A minimal, fast, and customizable prompt for any shell

#11

Does the speed of your shell matter? Surely the speed of the programs that you're running through your shell matter more. I've never been let down by how fast bash can tell a program to start running EDIT: oh, i misunderstood, its just the prompt at the start of your shell... I dont think ive ever been annoyed at how fast that renders either

Some people like to put, for example, their current git branch in the prompt. To get that means at least naively, running a git command on every single line the prompt renders on. Git is fast, but it's easy to add a bunch of these and suddenly your prompt takes 100ms to render. Hit enter a few times and you'll immediately notice lag. For that reason, doing this fast does make a real difference. Of course the fastest…

If you do not have any subshells or command substitutions in your PS1, then you also save alot of time on platforms like WSL, where forks are expensive.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#13
post #12

I found https://ohmyposh.dev/ works for me. There’s something about transient prompts that (at the time?) was a problem for starship. There are several other alternatives I’ve tried with meh results.

I've used Powerlevel10k for ages (https://github.com/romkatv/powerlevel10k), but it seems it's no longer actively developed / maintained. I think it's a lot cleaner, how I have it set up right now it shows some information like timestamp, Ruby versions, command runtime etc on the right side, whereas Starship shows it right at the prompt.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#17
I like maximalist prompts, and indeed Starship is what Shell Bling Ubuntu [1] installs on a new dev machine. But they're not everyone's cup of tea.

If I wanted to recommend to someone the min-maxed, highest density thing they could add to their prompt, it would simply be the time your current prompt appeared + the amount of time the last command you ran took.

These two pieces of information together make it very easy for you (or your local sysadmin (or an LLM looking over your digital shoulder)) to piece together a log of exactly what happened when. This kind of psuedo-non-repudiation can be invaluable for debugging sessions when you least expect it.

This was a tip I distilled from Michael W. Lucas's Networking for System Administrators a few years ago, which remains my preferred recommendation for any developers looking to learn just enough about networking to not feel totally lost when talking to an actual network engineer.

Bonus nerd points if you measure time in seconds since the UNIX epoch. Very easy and fast to run time delta calculations if you do that:

    [0 1719242840] $ echo "foo"
    [0 1719242905] $ echo "fell asleep before hitting enter" && sleep 5
    [5 1719242910] $
[1]: https://github.com/hiAndrewQuinn/shell-bling-ubuntu

Re: Starship: A minimal, fast, and customizable prompt for any shell

#18

I don’t understand why they market this as “minimal”. It’s got loads of features, and every time I see somebody use it they have a huge prompt with loads of bells and whistles. My shell prompt is: : ▶ You don’t need an entire shell prompt customisation framework to be minimal.

Compared to other shells and prompts, the configuration is really straightforward and minimal if you want something mildly complex.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#19

I don’t understand why they market this as “minimal”. It’s got loads of features, and every time I see somebody use it they have a huge prompt with loads of bells and whistles. My shell prompt is: : ▶ You don’t need an entire shell prompt customisation framework to be minimal.

Mine is an even thinner arrow.

# clean, simple, minimal

  PROMPT='%{%F{red}%}%~ %{%F{yellow}%}% › %{%F{reset_color}%}%'

Re: Starship: A minimal, fast, and customizable prompt for any shell

#20

I like maximalist prompts, and indeed Starship is what Shell Bling Ubuntu [1] installs on a new dev machine. But they're not everyone's cup of tea. If I wanted to recommend to someone the min-maxed, highest density thing they could add to their prompt, it would simply be the time your current prompt appeared + the amount of time the last command you ran took. These two pieces of information together make it very easy…

For personal workstation, the current directory is enough. Maybe I change the color based the status of the last command. That’s pretty much the only information I need before entering any command. Everything else can be accessed when I really need it.
Post reply on HN