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:
It's really nice, because it doesn't just tell you time between command executions (or rather time between commands finishing), but the actual runtime duration of the command.
I love nushell. You can also query by friendlier things than index:
history | where exit_status == 127 | last | get duration
2sec 410ms
The syntax ends up very clean looking since the data going through the pipes is typed, and the error messages are top notch
× Types 'duration' and 'int' are not compatible for the '-' operator.
╭─[entry #47:1:2]
1 │ (history | where exit_status == 127 | last | get duration) - 10
· ───┬─── ┬ ─┬
· │ │ ╰── int
· │ ╰── does not operate between 'duration' and 'int'
· ╰── duration
╰────
I never bothered configuring my prompt at all because, inside emacs, I could already see most of what I needed in the editor itself.
In fact, I only set up Starship when I started to do more pairing. It wasn’t for my benefit as much as it was for those watching my screen and checking the work, especially when operating on prod and confirming what we wanted to run. I just load up a separate terminal app for that so I don’t have to walk people through my setup.
Current time in a more human-readable format is very helpful sometimes. Also, the exit status of the previous command, if nonzero, is also very helpful when anything fails.
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.
You don't need to know what branch you're on before running commands? I cant tell you the number of times ive been on the wrong branch executing stuff.
I like stuffing everything which might be important to the context window in there, personally. Saving 50ms on the prompt load sure beats a false negative when something goes wrong because I don't even think to ask whether I have the wrong Node version installed or something.
You could probably (I haven’t tested it) append the run time as a comment to the history using something like PROMPT_COMMAND and `history -r <(…)`, instead of cluttering the prompt with it. And the start time is already in the history, using HISTTIMEFORMAT.
int history_write_timestamps
If non-zero, timestamps are written to the history file, so they can be preserved between sessions. The default value is 0, [...]
So this isn't true by default on many machines unless it is explicitly turned on. Once you do have it on, of course, then I agree.
This is why I really appreciate tools like Atuin. It augments your history with extra data such as the working directory, exit code, time to run command.
I would be very curious to see an age demographic chart of people using e.g. Starship.
Personally, over time, I have stopped caring too much about prompt customization. I concluded that, no matter how carefully you curate your prompt, 90% of the information shown will be irrelevant 90% of the time*. After a while, your brain will start perceiving this as visual clutter and filter it out, to the point you may even forget the information is there, right in front of your eyes.
And for the things that matter, you probably need more details than any prompt can show you. E.g. are there changes in your git branch? Ok there are, good to know, but which files have changed? Just knowing that there are changes is not really actionable information. You need to run additional commands to get actionable details.
* the numbers are completely arbitrary, but you get the picture
I've been coding for 20 years, I very much like having git info in the prompt. Even if it doesn't tell me everything (and it often doesn't) it _is_ a reminder that I have uncommitted changes, or haven't pushed yet, or a stash that I might have forgotten about.
I played with Starship for an hour this morning - the joys of 50 person planning meetings - but ultimately uninstalled it. I did like some of its options like command timing and success/error, but all the tool versions ultimately just felt like noise. Not worth the effort to maintain a complex custom config to trim it down to what I'd want.
I've tried prompts in the past, and they mostly annoyed me, or never showed me useful information. I've been a happy starship user for several years now. I've got the config tweaked so that it only shows me things I specifically care about. It's lightning fast.
I think we can generalize this into the overall computing environment. When I was younger, I was that kid building my whole OS from source via Gentoo, with all the CPU-specific flags and optimizations. I had a very detailed window manager configuration (fwvm2 maybe?), a .bashrc full of aliases and functions for every occasion. And yes, a custom prompt.
I think these kinds of over-optimization rabbit holes are a good learning experience, but I compare it to woodworking. A woodworker just starting out will spend most of his/her time building or refining the tools they need, learning techniques, coming up with ideas/designs and testing them, etc. But eventually the point comes where you have to get Real Work done and the tools and jigs have to wait until the weekend.
Linux is still my favorite desktop OS, but these days I just run Debian and KDE because "free time" is not a thing I have anymore and I care more about getting things done than having the most optimal computing experience.
I still have free time, my shift to default config and stable software was caused by how many workfkow changes for no reason I could stomach. I rarely need the latest features. Getting things to work and expecting to stay working for a while is the basic premise of computing.
As a counterpoint, one of the most useful customizations I've made to my prompt is to emit the exit status of the prior command. Knowing that something failed is a useful signal, esp. when sometimes the thing failing just fails to emit any output that indicates that it failed.
I only emit it if the prior command fails, too, so it doesn't clutter things the 90% of the time things are working.
» true
» false
(last command returned 1.)
»
I also translate signals, so I get "last command exited on SIGSEGV", or so.
It's also useful the other way: when a program emits and error and exits with "success".
I like the exit code feature a lot; Starship does that with my config in a subtle color change.
My shell customization is largely throwing Starship in (so it looks the same on all the machines I use -- Ubuntu servers at work, macOS at home, nixOS/Fedora/etc. servers for personal use.) and a starship.toml I wrote once and now leave alone.
> Personally, over time, I have stopped caring too much about prompt customization.
For a while, I tried a couple of Christmas tree prompts which included all kinds of condensed Git status and other bells and whistles, but eventually tired of them and settled on:
- Exit status of the previous command, if nonzero.
- Current time, HH:MM, 24 hour format.
- user@host, red if euid 0, green otherwise.
- Current directory, shortened if the path has three or more elements, with home directory recognition.
- Current directory, full path, echoed as hardstatus and hence appearing in the terminal window title.
- The name of the current branch if within a Git repo.
- Prompt character, dollar/hash sign.
All those elements are meaningful to me, inasmuch as I can quickly orient myself using that information and explore further if I notice anything out of the ordinary.
I'm pretty sure that megaprompt programs like Starship could produce the above, but I like obtaining a familiar prompt with a minimum of external dependencies, and so have written it all in Bash, then ported to Zsh and various Korn shells, which was quite tricky. It probably wouldn't work on Xenix 286, but anything newer has a fighting chance.
I’m “very senior” (as in decades of _Unix_ use senior) and I like it in minimal mode because it’s just so much less hassle than all the other zsh stuff I had been using for a couple of decades. Not sure if you expected replies to be full of all the JavaScript kids that use emojis in logging messages, but apologies if so :)
Same here. I’ve been using Unix of some flavor or another since 1989 and generally prefer minimalism and simplicity - but I also prefer “opinionated good defaults”, and starship gives me that. (I’ve even switched to Fish, because it does well with no config absolutely basic table stakes stuff OOTB that bash/zsh need a ton of garbage for.)
I'm senior, been working in the industry for closing on 25 years now, majority of that dealing with *nix systems of various descriptions. I usually avoid anything "ohh shiny".
I've tried prompts in the past, and they mostly annoyed me, or never showed me useful information. I've been a happy starship user for several years now. I've got the config tweaked so that it only shows me things I specifically care about. It's lightning fast.
26 years with Linux. I use starship but primarily because I administer multiple kubernetes clusters and having the kube context staring me in the face is critical. I don't adjust the default config more than just making sure the kube bits are enabled.
That said my vimrc is 2 lines that i can configure manually, I don't touch bash config from Debian defaults and my fish config is vanilla save for a handful of functions because I'm a lazy. My ssh config is pretty heavily customized but mostly around what keys/usernames to default to for which hosts (see previous about lazy).
This is me. All I need to know is my current directory, and the status in color of my last command (red for failed, green for zero [my prompt starts with ->]). That's it.
It also gives me the current branch in a directory that has git, just so I'm sure of what I'm working on-- but most of the time that's handled by whatever editor I'm using.
Ignore the haters - I too am a fan of minimalism in my terminal since I don't appreciate unnecessary clutter or decoration, but context is king and Starship can be configured as such.
By default my prompt is a shows me the current directory, the time, and a single character '%'. If I set something in my environment for which I need to be contextually aware - i.e if I have KUBECONFIG or OS_CLOUD - then the prompt is updated with the detail. Similar for languages - it'll automatically show me the version of Go or Python or whatever based on a few factors, all of which I can control.
The reason I love Starship is that it's made all this very, very easy to configure - instead of having to wade through arcane Zsh configuration or additional plugins, Starship makes it easy. It also adds negligible overhead to initialisation, especially when done so via evalcache [0]
I also have very few always on segments, and many conditional segments that only show up when useful. Host shows when I'm not on the usual, user when I'm not me, and stuff like that.
Fan of starship here. wanted to drop a few comments based on what I seen so far
Love the performance. Written in Rust and compiled to binary, it's _much_ faster than either python-based powerline, the bash-shell-based ohmybash and zshell-based ohmyzsh and spaceship.
You can use it for zsh, bash, sh, fish. but you can also use it for both MS Windows CMD and Powershell. I don't believe any other prompt tools can do all at the same time. And a single config file can control all of them on your system.
The default config is just that - a default. Too much information? you can change it. dont like icons? you can remove them.
At almost 100 modules to choose from, it's customization options are nearly limitless
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.
I really like this one for just being a single install and then no more fiddling. I don’t have time for any of that shit, but I do want to know whether my current shell is on node 20 or 22, rust stable or nightly. Getting all of that without extra effort is great.
What am I missing? I went to the site, but I can find nothing to suggest why I might want to use this. Are there examples that I've missed, likely owing to having been heads down chasing a pernicious heisenbug all day?
Given that I do like my shiny prompt, which shows me:
The result of the last command (in green, red, or purple)
user@host:currentDirectory
current branch, if in a repo
with the last line showing summary git status, if in a repo, and background jobs, I suspect I might be their market, but I cannot see a why anywhere.
(Green: Last command good, e.g., exit 0)
(Red: Last command non-zero exit, with a special indicator if it was interrupted)
(Purple: Last command suspended, and few other things)
I tried starship a few years ago and found it too "extra" and sluggish. I'm sure it may have improved in this time, but I ended up sticking with the excellent Hydro[0], only for fish though.
It's very minimal while having useful features:
- exit codes, even for pipelines
- git branch, status (displayed as a dot if your tree is dirty) and ahead/behind counts
- command execution time (if above some configurable threshold)
- truncated/minified $CWD, always maintaining the git root's name (I sometimes like it, sometimes don't; fortunately, it's very easy to change)
- current vi-like mode (I don't use that)
It's very fast and async (prompt repaints don't block your input or running commands), and totals 132 lines of fish (according to cloc[1]). It's also very customisable through variables, which can be declared as universal to instantly change on all sessions you have open.
If you're on fish and like this feature set, definitely give it a shot, or at least look at the code as a base for a bespoke prompt :P
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:
[1]: https://github.com/hiAndrewQuinn/shell-bling-ubuntuIn fact, I only set up Starship when I started to do more pairing. It wasn’t for my benefit as much as it was for those watching my screen and checking the work, especially when operating on prod and confirming what we wanted to run. I just load up a separate terminal app for that so I don’t have to walk people through my setup.
Personally, over time, I have stopped caring too much about prompt customization. I concluded that, no matter how carefully you curate your prompt, 90% of the information shown will be irrelevant 90% of the time*. After a while, your brain will start perceiving this as visual clutter and filter it out, to the point you may even forget the information is there, right in front of your eyes.
And for the things that matter, you probably need more details than any prompt can show you. E.g. are there changes in your git branch? Ok there are, good to know, but which files have changed? Just knowing that there are changes is not really actionable information. You need to run additional commands to get actionable details.
* the numbers are completely arbitrary, but you get the picture
I played with Starship for an hour this morning - the joys of 50 person planning meetings - but ultimately uninstalled it. I did like some of its options like command timing and success/error, but all the tool versions ultimately just felt like noise. Not worth the effort to maintain a complex custom config to trim it down to what I'd want.
I agree there's a lot of noise that seems to be there by default.
For most of my career I used a very simple PS1:
timestamp, who I am, what box I'm on, where I am.I've tried prompts in the past, and they mostly annoyed me, or never showed me useful information. I've been a happy starship user for several years now. I've got the config tweaked so that it only shows me things I specifically care about. It's lightning fast.
I think these kinds of over-optimization rabbit holes are a good learning experience, but I compare it to woodworking. A woodworker just starting out will spend most of his/her time building or refining the tools they need, learning techniques, coming up with ideas/designs and testing them, etc. But eventually the point comes where you have to get Real Work done and the tools and jigs have to wait until the weekend.
Linux is still my favorite desktop OS, but these days I just run Debian and KDE because "free time" is not a thing I have anymore and I care more about getting things done than having the most optimal computing experience.
I only emit it if the prior command fails, too, so it doesn't clutter things the 90% of the time things are working.
I also translate signals, so I get "last command exited on SIGSEGV", or so.It's also useful the other way: when a program emits and error and exits with "success".
My shell customization is largely throwing Starship in (so it looks the same on all the machines I use -- Ubuntu servers at work, macOS at home, nixOS/Fedora/etc. servers for personal use.) and a starship.toml I wrote once and now leave alone.
For a while, I tried a couple of Christmas tree prompts which included all kinds of condensed Git status and other bells and whistles, but eventually tired of them and settled on:
- Exit status of the previous command, if nonzero.
- Current time, HH:MM, 24 hour format.
- user@host, red if euid 0, green otherwise.
- Current directory, shortened if the path has three or more elements, with home directory recognition.
- Current directory, full path, echoed as hardstatus and hence appearing in the terminal window title.
- The name of the current branch if within a Git repo.
- Prompt character, dollar/hash sign.
All those elements are meaningful to me, inasmuch as I can quickly orient myself using that information and explore further if I notice anything out of the ordinary.
I'm pretty sure that megaprompt programs like Starship could produce the above, but I like obtaining a familiar prompt with a minimum of external dependencies, and so have written it all in Bash, then ported to Zsh and various Korn shells, which was quite tricky. It probably wouldn't work on Xenix 286, but anything newer has a fighting chance.
And now that you mention it, next year will be my 30th Unix-versary. Time flies... Still not a greybeard though.
I've tried prompts in the past, and they mostly annoyed me, or never showed me useful information. I've been a happy starship user for several years now. I've got the config tweaked so that it only shows me things I specifically care about. It's lightning fast.
That said my vimrc is 2 lines that i can configure manually, I don't touch bash config from Debian defaults and my fish config is vanilla save for a handful of functions because I'm a lazy. My ssh config is pretty heavily customized but mostly around what keys/usernames to default to for which hosts (see previous about lazy).
It also gives me the current branch in a directory that has git, just so I'm sure of what I'm working on-- but most of the time that's handled by whatever editor I'm using.
A few years ago I progressed to having the current directory in there.
The thought of running a child process to create my prompt every time I hit enter doesn't feel right.
I should know what git branch I'm in, and if I don't it's a simple command away.
By default my prompt is a shows me the current directory, the time, and a single character '%'. If I set something in my environment for which I need to be contextually aware - i.e if I have KUBECONFIG or OS_CLOUD - then the prompt is updated with the detail. Similar for languages - it'll automatically show me the version of Go or Python or whatever based on a few factors, all of which I can control.
The reason I love Starship is that it's made all this very, very easy to configure - instead of having to wade through arcane Zsh configuration or additional plugins, Starship makes it easy. It also adds negligible overhead to initialisation, especially when done so via evalcache [0]
[0] https://github.com/mroth/evalcache
Love the performance. Written in Rust and compiled to binary, it's _much_ faster than either python-based powerline, the bash-shell-based ohmybash and zshell-based ohmyzsh and spaceship.
You can use it for zsh, bash, sh, fish. but you can also use it for both MS Windows CMD and Powershell. I don't believe any other prompt tools can do all at the same time. And a single config file can control all of them on your system.
The default config is just that - a default. Too much information? you can change it. dont like icons? you can remove them.
At almost 100 modules to choose from, it's customization options are nearly limitless
My shell prompt is:
You don’t need an entire shell prompt customisation framework to be minimal.# clean, simple, minimal
Given that I do like my shiny prompt, which shows me:
with the last line showing summary git status, if in a repo, and background jobs, I suspect I might be their market, but I cannot see a why anywhere.(Green: Last command good, e.g., exit 0) (Red: Last command non-zero exit, with a special indicator if it was interrupted) (Purple: Last command suspended, and few other things)
Deleted Comment
It's very minimal while having useful features: - exit codes, even for pipelines - git branch, status (displayed as a dot if your tree is dirty) and ahead/behind counts - command execution time (if above some configurable threshold) - truncated/minified $CWD, always maintaining the git root's name (I sometimes like it, sometimes don't; fortunately, it's very easy to change) - current vi-like mode (I don't use that)
It's very fast and async (prompt repaints don't block your input or running commands), and totals 132 lines of fish (according to cloc[1]). It's also very customisable through variables, which can be declared as universal to instantly change on all sessions you have open.
If you're on fish and like this feature set, definitely give it a shot, or at least look at the code as a base for a bespoke prompt :P
[0]: https://github.com/jorgebucaran/hydro [1]: https://github.com/AlDanial/cloc