I've been using Starship for quite some time, and it's awesome! Definitely recommend it to anyone who wants a fast, modern, and rich prompt.
Besides the product, the community is pleasantly awesome as well. I've contributed a module to it and the maintainer has done a good job reviewing and testing. Heck, they even have a Discord server for contributors.
I've tried a number of different shell prompt tools over the past few decades. I've disliked them all due to their latency. I don't want to "feel" the delay. They were all in scripting languages, be it native bash, or python or whatever.
I tried out starship about three years ago and it is so fast I don't notice its execution time at all. I switched and haven't looked back.
If your shell is ZSH and you have `setopt autocd` in your .zshrc (though I think this setting is on by default):
export PS1="%~; "
this will result in the prompt: `~; ` where the ~ will change to a path relative to home.
Why do this? Well; it means you can select and paste any line in your history: your prompt becomes part of setting the proper context and is part of the command. Just select the entire line. :D
I think a huge amount of these prompts are just fiddling with things because people think they are clever, not because they are actually useful.
My prompt for years has been:
: ▶
I add the hostname if it’s an SSH session and change ▶ to # if I’m root because those are both important contexts that should be omnipresent, but aside from that, I haven’t felt like I’m missing anything at all. The CWD is in the window / tab title bar, but I never need to look at it because the CWD is always so closely tied to what I am doing in the shell that it’s always top of mind.
I love Fish, but I cannot for the life of me to get Starship working well.
Trying to get it working on WSL (Ubuntu 20.04 and Centos) as well as MSYS just wasn't happening. On the few occasions I did get it working, it was unbearably slow. Simple commands would have sometimes half a second of delay. I could time what was causing the slowdown and disable some of it, but by the time I got it bearable I had disabled basically all of Starship. Then there were font-related issues on top. Ugh.
Chiming in as another fish+starship user. It's hard to imagine using anything else now; I get just about every feature I would ever want out of my shell with essentially zero configuration, which makes it easy to replicate my setup across a ton of heterogeneous devices and operating systems.
I discovered starship when I started using kubernetes at work. Previously I relied on standard bash-isms for path, hostname, etc. but knowing what context and namespace I'm in before I execute a command is quite convenient. I'm normally not one to "customize" my CLI experience at all but this was a nice addition to the toolbox. Documentation is good, customizable, reliable and has support for a lot of things. Would recommend.
> Rust is not a user feature, it's an implementation detail
Sure, but keep in mind that in the case of open source software plenty of people will choose software written in their favorite language so that they can potentially contribute to it. Or simply because they feel more connected to something that is written in their favorite language. So I don't think it's completely irrelevant.
It might not be a feature, but it is a selling point. It conveys that it was written relatively recently, is more likely to support modern features in the shell, runs reasonably fast and is reasonably portable.
If it was written in JS or python I'd already start worrying about what package manager to install it with in which environment, installing it globally is an anti pattern but symlinking it to .local/bin might complicate it.
So IMHO, the language something is written in is not just an implementation detail, it informs me in how well it will perform.
I like that go and rust binaries are statically linked. This means that I can build an environment I like using these and bring them almost everywhere, wsl, Mac, Ubuntu, red hat, etc. For me, this is the feature of rust/go.
It's not only though I don't understand why is this getting you "tired".
Rust has memory safety built in (unless one goes VERY out of their way to nullify it) which to many, myself included, is a selling point. F.ex. I wouldn't be interested in the userland tools rewrite if they weren't in Rust.
> Rust is not a user feature, it's an implementation detail.
It is that, yes, but not only that. Again, memory safety. And as another poster pointed out -- statically linked binaries. That helps a lot with certain deployments.
Also consider that HN might not be the place for you if mentioning implementation details are ticking you off. That's more or less how this forum started in the first place: people discussing implementation details.
> Rust is not a user feature, it's an implementation detail.
Rust is the new C. It communicates that something is fast, but also secure, and new or a modern reimplementation of something old. So, in that sense, is it a user feature because it has established itself in a way that tells the user some important details.
Am I the only one who is getting tired of comments complaining about people put “written in Rust” in the title? Lately every post having “written in Rust” has a comment like this.
If you don’t care, ignore it. Why should it bother you so much?
"X in Rust" to me mean that I won't have to fiddle with it when installing it and it'll work out of the box. This isn't unique to Rust, Go does this very well too. It'll also be reasonably fast, not just because of the language, but because the community likes performance. For example, a few years ago I tried the tldr command. It was in Node.js and unbearably slow. There was a Rust implementation, tealdeer, that was way faster.
Switching to Starship was actually what inspired me to also switch from Bash to Fish. Purely because of the transient prompt feature, which is not supported for Bash.
With the transient prompt, you can have things like Git or Kubernetes status on your “main prompt”, but without always printing them in the terminal for the commands you ran previously. It keeps the history much cleaner, and therefore more pleasant to scroll back up. I've also configured it to print the time when the commands were executed to the start of the lines.
These context clues are especially important for newcomers to the command line. A CLI newbie who sticks with it might eventually progress to the point where they decide to ditch Starship, or to ditch fish, or to ditch both, but until they get to that point, the solid defaults and OOTB features of these two have a lot going for them. Meanwhile sticking someone in a '$ ' with no coloring, no autocompletion, and no real clues in the terminal itself is more likely to lead to them just giving up entirely.
Maybe it can turn into the default prompt as a library dependency after the Rust rewrite, but the rust rewrite needs to rollout before thinking too far ahead.
Here is another one which only uses the shells own facilities:
current-directory@hostname $
Running a complex piece of software every time the shell needs to display it's prompt, is not "minimal", regardless of how fast and well written said piece of software is.
I had a similar reaction to the out of the box config. However after spending a little bit of time with the doc, I turned off all the useless stuff like my docker version and but left stuff like git branch, status, exit code, etc.
I spend so little time relatively on my own machine’s terminal and even when I do I don’t want it to be totally different from the boxes I SSH into every day. That context switch would be frustrating. Nor do I have the desire to push for something like this to be installed on our fleet of servers.
Do the people who use this (along with terminal emulators that require you install things on the host to get the full power) just not use other machines and/or install stuff like this on them? Just seems odd to me personally but I’m interested in how others use it. Do you only use your own computer/terminal so it’s not an issue?
I suppose I “just don’t use other machines” and when I do, they suck and mine rocks, which I consider a lot better than “both sucks, but I am used to it”
If you want to, you can invest time in automating this so that you can feel at home at every boxes.
Surely it is some work to ensure your user environment are all the same across different machines. But it is also liberating as you are no longer limited to choose the few common features available everywhere.
If it's a machine that you're going to be working on a lot, you might as well have good tools installed. (And if it's a machine where stuff like starship would be bloat, then it's probably not something people should be SSHing into frequently).
The main reason I use fish shell is for the autocompletion feature it offers out of the box. If it had been an option back in the day, I would have tried something like starship
It's quite portable (didn't test on Windows though); ~170 lines of Go; no dependencies outside of stdlib; calls no external commands; supports SSH, git, Docker, nix, and virtualenv; extremely simple to hack on.
`custom` spawns a child process of your shell, so it's probably being slowed down by a slow shell init script.
If the custom script you're running doesn't require your full shell customization to work, you can provide a custom shell command [0], passing an argument to not use your shell config.
For instance: `fish --no-config` or `bash --noprofile --norc`
So now I need to install nerd font and this software on all clients' machines and VMs and whatnot. Asking IT departments for permission and waiting for compliance check.
Or should I do it only on toy machines, risking different experience between them and production.
No, thanks. Plain bash will suffice. Just like it did for so many years.
I tried this couple of times and once a few days ago and wasn’t impressed. Coming from powerlevel10k it seems more limiting and not really faster. Has anyone think starship is better than powerlevel10k and how?
Maybe read through the documentation and try it out. It has very robust configuration options, many pre-built modules that are ready to include in your prompt, for example, one that prints git info for the current location if it's a repository.
So yes, it is kind of a competitor to p10k, but not zsh. It's just the prompt, and it just focuses on being a very good prompt tool.
It's simpler to configure and extend, and also more likely gets support for more exotic information-sources. It's a dedicated tool for this specific job, so following the "Unix-philosophy". And probably more optimized for edge cases like big git-repos and stuff. And you can easily switch shells.
I have a bookmark-folder of release-sites and changelogs I visit ever some months. Though, they are on github, which has a Newsfeed, so at some point I switch to a feedreader or mail-forwarder to have this more under control. But I'm still searching for something good.
If you find that wasteful, you can use the “transient prompt” feature to only print the full prompt to the current line, but keep the command history on one line per command in the terminal.
In contrast to the minimalist philosophy, I want to have as much visual information about the active state of my session as possible. So many stories of deleted files and databases, botched git actions and server crashes due to admins/devs forgetting which folder/host they are on, or which user they are logged in as, or whether the previous command failed or not.
Personally, I find the extra blank line to be a useful visual separator between lines of output. Particularly useful when running commands with lots of output or 'cat'-ing files or logs.
lot of information that'd be nicer to have at a higher level than the prompt, like the tmux or screen status bar. Be even better if a "prompt" like this could set a variable using ANSI escapes that various terminal emulators could display.
It’s too bad this requires a Nerd font to be installed according to the landing page. I just don’t think that belongs in a terminal emulator and it should be optional
The homepage is somewhat misleading, you can use it without Nerd Fonts and there's actually a preset config listed for it mentioned on the Presets page [0] with the note:
> This preset will become the default preset in a future release of starship
It also links to an open issue on the GH repo about it [1] (although that issue is 2 years old and doesn't seem to be top priority.)
juxtapose|2 years ago
Besides the product, the community is pleasantly awesome as well. I've contributed a module to it and the maintainer has done a good job reviewing and testing. Heck, they even have a Discord server for contributors.
Twirrim|2 years ago
I tried out starship about three years ago and it is so fast I don't notice its execution time at all. I switched and haven't looked back.
neilv|2 years ago
dijit|2 years ago
If your shell is ZSH and you have `setopt autocd` in your .zshrc (though I think this setting is on by default):
export PS1="%~; "
this will result in the prompt: `~; ` where the ~ will change to a path relative to home.
Why do this? Well; it means you can select and paste any line in your history: your prompt becomes part of setting the proper context and is part of the command. Just select the entire line. :D
JimDabell|2 years ago
My prompt for years has been:
I add the hostname if it’s an SSH session and change ▶ to # if I’m root because those are both important contexts that should be omnipresent, but aside from that, I haven’t felt like I’m missing anything at all. The CWD is in the window / tab title bar, but I never need to look at it because the CWD is always so closely tied to what I am doing in the shell that it’s always top of mind.Narushia|2 years ago
Night_Thastus|2 years ago
Trying to get it working on WSL (Ubuntu 20.04 and Centos) as well as MSYS just wasn't happening. On the few occasions I did get it working, it was unbearably slow. Simple commands would have sometimes half a second of delay. I could time what was causing the slowdown and disable some of it, but by the time I got it bearable I had disabled basically all of Starship. Then there were font-related issues on top. Ugh.
I hope others have a better experience than I.
3PS|2 years ago
blooalien|2 years ago
lazypenguin|2 years ago
weebull|2 years ago
Rust is not a user feature, it's an implementation detail.
<cue people telling me I should consider Rust a feature>
farresito|2 years ago
Sure, but keep in mind that in the case of open source software plenty of people will choose software written in their favorite language so that they can potentially contribute to it. Or simply because they feel more connected to something that is written in their favorite language. So I don't think it's completely irrelevant.
gnur|2 years ago
If it was written in JS or python I'd already start worrying about what package manager to install it with in which environment, installing it globally is an anti pattern but symlinking it to .local/bin might complicate it.
So IMHO, the language something is written in is not just an implementation detail, it informs me in how well it will perform.
eviks|2 years ago
jpambrun|2 years ago
timeon|2 years ago
rowanG077|2 years ago
pdimitar|2 years ago
Rust has memory safety built in (unless one goes VERY out of their way to nullify it) which to many, myself included, is a selling point. F.ex. I wouldn't be interested in the userland tools rewrite if they weren't in Rust.
> Rust is not a user feature, it's an implementation detail.
It is that, yes, but not only that. Again, memory safety. And as another poster pointed out -- statically linked binaries. That helps a lot with certain deployments.
Also consider that HN might not be the place for you if mentioning implementation details are ticking you off. That's more or less how this forum started in the first place: people discussing implementation details.
theshrike79|2 years ago
PurpleRamen|2 years ago
Rust is the new C. It communicates that something is fast, but also secure, and new or a modern reimplementation of something old. So, in that sense, is it a user feature because it has established itself in a way that tells the user some important details.
KolenCh|2 years ago
If you don’t care, ignore it. Why should it bother you so much?
darthrupert|2 years ago
I think it has become a significant user feature.
itishappy|2 years ago
I think you might just be prejudiced. Do you have the same reaction to, say, SQLite?
https://www.sqlite.org/index.html
> SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine.
a_random_canuck|2 years ago
Rust’s memory safety definitely makes it a user feature.
Zababa|2 years ago
rgoulter|2 years ago
I think it goes well with the fish shell: it's much nicer than the default, without requiring customisation.
Narushia|2 years ago
With the transient prompt, you can have things like Git or Kubernetes status on your “main prompt”, but without always printing them in the terminal for the commands you ran previously. It keeps the history much cleaner, and therefore more pleasant to scroll back up. I've also configured it to print the time when the commands were executed to the start of the lines.
hiAndrewQuinn|2 years ago
These context clues are especially important for newcomers to the command line. A CLI newbie who sticks with it might eventually progress to the point where they decide to ditch Starship, or to ditch fish, or to ditch both, but until they get to that point, the solid defaults and OOTB features of these two have a lot going for them. Meanwhile sticking someone in a '$ ' with no coloring, no autocompletion, and no real clues in the terminal itself is more likely to lead to them just giving up entirely.
dietr1ch|2 years ago
srid|2 years ago
https://github.com/srid/nixos-config/blob/master/home/starsh...
Incidentally, starship also gives a visual indication of whether you are in the nix shell or not, which is pretty handy when using direnv:
https://nixos.asia/en/direnv
myaccountonhn|2 years ago
mkl|2 years ago
konart|2 years ago
Having 8 (or more) colors help when dealing with information though, at least when you need to get a quick result and not just dig into the man pages.
lazypenguin|2 years ago
Hamuko|2 years ago
chrisan|2 years ago
eviks|2 years ago
illusive4080|2 years ago
[deleted]
usrbinbash|2 years ago
Here is what a minimal shell prompt looks like:
Here is another one which only uses the shells own facilities: Running a complex piece of software every time the shell needs to display it's prompt, is not "minimal", regardless of how fast and well written said piece of software is.daliusd|2 years ago
tecoholic|2 years ago
gkfasdfasdf|2 years ago
notnmeyer|2 years ago
joshstrange|2 years ago
Do the people who use this (along with terminal emulators that require you install things on the host to get the full power) just not use other machines and/or install stuff like this on them? Just seems odd to me personally but I’m interested in how others use it. Do you only use your own computer/terminal so it’s not an issue?
wodenokoto|2 years ago
KolenCh|2 years ago
Surely it is some work to ensure your user environment are all the same across different machines. But it is also liberating as you are no longer limited to choose the few common features available everywhere.
rgoulter|2 years ago
the_gipsy|2 years ago
Another minimal prompt: https://lib.rs/crates/pista
leo150|2 years ago
shakow|2 years ago
rollcat|2 years ago
https://github.com/rollcat/etc/tree/master/cmd/prompter
It's quite portable (didn't test on Windows though); ~170 lines of Go; no dependencies outside of stdlib; calls no external commands; supports SSH, git, Docker, nix, and virtualenv; extremely simple to hack on.
skrebbel|2 years ago
jwalton|2 years ago
jasonjmcghee|2 years ago
daliusd|2 years ago
matchai|2 years ago
`custom` spawns a child process of your shell, so it's probably being slowed down by a slow shell init script. If the custom script you're running doesn't require your full shell customization to work, you can provide a custom shell command [0], passing an argument to not use your shell config. For instance: `fish --no-config` or `bash --noprofile --norc`
[0]: https://starship.rs/config/#custom-command-shell
HackerThemAll|2 years ago
Or should I do it only on toy machines, risking different experience between them and production.
No, thanks. Plain bash will suffice. Just like it did for so many years.
KolenCh|2 years ago
microflash|2 years ago
KolenCh|2 years ago
Thanks.
shmerl|2 years ago
I usually use simple ^ but having something like there would be nicer.
abhinavk|2 years ago
tracker1|2 years ago
AtlasBarfed|2 years ago
What makes this "infinitely customizable" aside from being turing complete?
I don't see anything but ... a prompt.
retrochameleon|2 years ago
So yes, it is kind of a competitor to p10k, but not zsh. It's just the prompt, and it just focuses on being a very good prompt tool.
elcombato|2 years ago
drivingmenuts|2 years ago
PurpleRamen|2 years ago
arun-mani-j|2 years ago
theshrike79|2 years ago
Need to check on how to handle it on shells with no root access.
Narushia|2 years ago
PurpleRamen|2 years ago
microflash|2 years ago
cranberryturkey|2 years ago
ludovicianul|2 years ago
arrakeen|2 years ago
konart|2 years ago
I'd like to have some usefull information about my session but also prefer when my input begins from the first column.
BiteCode_dev|2 years ago
Narushia|2 years ago
ykonstant|2 years ago
xigoi|2 years ago
sevg|2 years ago
Personally, I find the extra blank line to be a useful visual separator between lines of output. Particularly useful when running commands with lots of output or 'cat'-ing files or logs.
Hamuko|2 years ago
petesergeant|2 years ago
YuukiRey|2 years ago
dabber|2 years ago
> This preset will become the default preset in a future release of starship
It also links to an open issue on the GH repo about it [1] (although that issue is 2 years old and doesn't seem to be top priority.)
[0]: https://starship.rs/presets/#nerd-font-symbols
[2]: https://github.com/starship/starship/pull/3544
tracker1|2 years ago
Other fonts work to. I use Fira Code myself.
fodkodrasz|2 years ago
unknown|2 years ago
[deleted]
bbqbbqbbq|2 years ago
[deleted]