logoalt Hacker News

hiAndrewQuinn06/24/20256 repliesview on HN

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

Replies

MyOutfitIsVague06/24/2025

nushell does that out of the box:

    > history | get 82076
    ╭─────────────────┬──────────────────╮
    │ start_timestamp │ 2025-06-24 16:46 │
    │ command         │ mpc play         │
    │ cwd             │ /home/work       │
    │ duration        │ 1ms              │
    │ exit_status     │ 0                │
    ╰─────────────────┴──────────────────╯
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.
show 1 reply
ljm06/24/2025

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.

andrewflnr06/24/2025

The exit code of the last command is useful for similar reasons.

nine_k06/24/2025

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.

skydhash06/24/2025

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.

show 3 replies
layer806/24/2025

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.

show 2 replies