Posted by benoitg 7 days ago
- See current git branch (to not mistakenly work or commit into the wrong branch)
- See git has changes (to stash them before switching branches)
- See the current language/engine version (like go v1.24.2, because i use tools like gvm, sdk, nvm or rustup to switch version in projects and i want feedback that i have the correct/expected language version enabled)
- See that i am on my local or a remote machine and k8s context
That's mostly it. Of course, I can do this by writing my own prompt, but I found out that Starship does this for me, basically out of the box, on any machine and terminal, in a very nice-looking way. Also, I am not a fan of fancy-looking prompts, so visually, Starship fits best for me.
ends up looking like this: https://github.com/bbkane/dotfiles/blob/master/zsh/README_im...
It would be nice to have a comparison and reasons to change from popular tools.
Most shells can probably do everything this can as well and if you're already familiar with the archaic syntax there is probably limited use for you.
For an idea, here is my current config https://github.com/LukasKnuth/dotfiles/blob/main/zsh/.config...
I also expect it has everything that you have in your prompt so is a direct replacement without losing anything.
1) I don't recall having a problem with prompt speed.
2) Are there any benchmarks?
curl <url> | sh
then you could see on your terminal thousands of various tests related to your installation, then several megabytes being downloaded with progress bars, etc.At the very end of the whole process, the whole stuff would vanish into writing PS1="$ " at the end of your ~/.bashrc
Of course, the very same prompt was used whatever your install could be. I think it was some joke making fun of all these crazy and heavy custom prompts all around.
Run a full screen term on my machine for a good chunk of my workflow and I just like to have time and battery in my term. I render it as ‘(15:35) [80} <hostname> $ ‘ and for boxes without batteries it’s just ‘(15:35) <hostname> $ ‘
Some times I’ll go back through my scroll back and look at the time when I’m trying to figure things out. Or when I run a command that generates a ton of output, I’ll note the time and run the command then later search back to the time in scroll back to start at the top of the log.
None of these are features I truly miss on a vanilla box, I can look at a clock or watch and will put a comment into the scroll back to find later.
Just so I am clear, use your prompts as you see fit — I’m just trying to understand how others work. Thanks!
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.I could find no command line history for Bash when I poked around. I use the fish shell, however, which does embed timestamp data by default - but I rarely think to look there when the detail might be pertinent. C'est la vie.