←back to thread

457 points benoitg | 1 comments | | HN request time: 0s | source
Show context
m000 ◴[] No.44367731[source]
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

replies(12): >>44368415 #>>44368447 #>>44368864 #>>44369236 #>>44369278 #>>44370150 #>>44370843 #>>44371011 #>>44371393 #>>44373149 #>>44376069 #>>44385108 #
inejge ◴[] No.44370150[source]
> 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.

replies(2): >>44371819 #>>44376109 #
1. dajt ◴[] No.44376109[source]
That does look pretty good. I wouldn't bother with the time but I like the rest of it.