Top
Best
New

Posted by benoitg 7 days ago

Starship: A minimal, fast, and customizable prompt for any shell(starship.rs)
464 points | 211 commentspage 2
jamesponddotco 7 days ago|
I live in the terminal, so I wrote my own prompt ages ago when I started learning Go[1][2], and before that I had a simple prompt in bash.

I like to keep things very simple and fast, so the directory and the git branch is all I need. I wonder if people really use all that information or if they set it up thinking they need it, but then never do.

[1]: https://git.sr.ht/~jamesponddotco/gosh

[2]: I should probably update that now that I know a “bit” more Go.

touristtam 5 days ago||
I like the host you have that code on. That's refreshing to see a website that doesn't _require_ you to run some javascript.
williamdclt 7 days ago||
The only thing I add is the time (hh:mm:ss), it's often-ish useful to roughly know how long a command has been running for (or how long it took after it completed)
jayknight 6 days ago||
The `cmd_duration` starship module can additionally tell you how long the previous command took: https://starship.rs/config/#command-duration
kuon 7 days ago||
It looks nice.

I usually like simple prompt, but there is one feature I really like, it's the timestamp. It helps me remember when I did something and how long it tooks.

microflash 6 days ago||
I'm surprised by people conflating customizability with maximalism. Yes, the default configuration is a bit too much but you can turn the knobs to reign it in. I work on multiple AWS environments, different application runtimes, and so on. Having some context in the prompt has been very helpful for me. I maybe biased though since I've used Starship for years paired with Nushell.
tristor 7 days ago||
I have been using ZSH + various add-ons for ages, originally oh-my-zsh, and lately Prezto. I also somewhat maintain a fork of Prezto with improvements for Mac, mostly for my own personal use (although apparently quite a few others are using it as its gotten several stars). Historically I used powerline9k, powerlevel, powerline10k, and finally pure for the longest time. I switched to starship the last time it got posted on HN that I saw, which was around 2 or 3 years ago, and I've stuck with it since. For one thing, it had a mode to configure it exactly like pure very simply out of the box, and the second reason was because it was significantly faster. By moving more of the logic into starship and out of ZSH, it greatly reduced the performance hit I took by adding additional information into my prompt.

I know not everyone likes blinged out shells, but if you're a ZSH user, it fits very well into the Prezto/oh-my-zsh model.

faizmokh 7 days ago||
Tried it. Not a fan. I find it unnecessarily fancy.
Asraelite 7 days ago|
Then customize it not to be. Are you criticizing it for having too many configuration options?
account42 7 days ago|||
For a non-fancy prompt, setting PS1 is enough - no need to install anything.
faizmokh 6 days ago|||
If I have to do that I might as well maintain my current zsh config with antigen.

I criticized it because it's not "minimal" and it's not "blazing-fast".

iloveitaly 6 days ago||
I've been using it for awhile and love it:

https://github.com/iloveitaly/dotfiles/blob/master/.config/s...

eevahr 7 days ago||
My personal favourite: PS1="%~ $ "
blueflow 7 days ago|
I'm assuming that this is a zsh prompt string.
eevahr 6 days ago||
Yes, bash would be: PS1='\w \$ '
thibran 6 days ago||
Too bad that we still use text based shells in the year 2025. We should have come up with a graphical shell that is as powerful and flexible two decades ago.
ulbu 6 days ago||
text is discrete, graphical is continuous. very different psychologically. i disagree with you wholeheartedly.
touristtam 5 days ago||
What's a graphical shell in your mind if you don't mind me asking?
drcongo 7 days ago||
I love Starship. Having built a decent enough powerline prompt for zsh in the past, and really hating PS1, I've found Starship to be incredibly useful for building the exact prompt I want, with full colour, and never ever wigging out at anything. One simple toml file on every machine I ever ssh into and everything I need to know about the session is there at a glance.
nh2 6 days ago|
With or without starship, one problem I have with zsh prompts is that when I press Enter, there is still a visible delay where for a fraction of a second, the cursor moves to the beginning of the next line.

This makes a nasty "flashing" effect.

If I keep Enter pressed, the cursor is permanently visible at offset 0 in the lowest line.

If the prompt is ultra-fast (e.g. plain root shell prompt on zsh), it happens less (e.g. only 50% of cases), but as soon as the prompt does anything, it's very visible.

I observe this with many terminals (gnome-terminal, wezterm, kitty, alacritty, xterm).

The only terminal I tried that doesn't have this problem is urxvt, where it looks perfect.

Video repro: https://nh2.me/flashing-cursors-on-newline.mp4

Why, and is there a way around it for those other terminals?

nh2 6 days ago||
For Kitty I posted it on https://github.com/kovidgoyal/kitty/issues/8752, maybe we'll learn more!
big_alfredo 6 days ago||
Try tweaking kitty's input_delay setting. For example: kitty --override=input_delay=10
nh2 5 days ago||
input_delay doesn't seem to address this in general: Even when set to 50 (which is very noticeable), the cursor on the next line just appears with some delay.

None of the settings from https://sw.kovidgoyal.net/kitty/performance/ seem to affect its appearance.

big_alfredo 4 days ago||
Interesting, In zsh I experienced the exact behavior you described and setting input_delay to 10 completely resolved it. To be fair, when testing my PS1 was simply '%m$ '.

I just benchmarked 'starship prompt' and when in a directory managed by git, it can take well over 10ms. I imagine with a more advanced configuration it would take even longer. urxvt must be doing something special.

More comments...