Dissecting your bash prompt

I’ve always noticed really elaborate examples of what can be achieved with a highly customised PS1 variable for your bash prompt and recently have spent some time playing with my settings to make my terminal experience better with a few updates. I also felt that I would have benefitted in the past from being able to analyse what my prompt currently does, breaking it down into easier to digest blocks, so I can make more sense of what each part does.

As a result of that curiosity, I’ve created a small page that allows you to paste in an existing PS1 from your terminal which will then be parsed and previewed with some basic dummy details (which can be changed by clicking on the identifier in the preview area).

I’d like to make it into something like EzPrompt with support for 256, or even true colour additions and collate some useful scripts for displaying additional information, but at the moment it’s useful for seeing what each block does at least.

It seems to cover most of the examples I’ve tested in various searches, but the more inline-code is included, the less it can display.

Check it out here and the source is available on github.

Leave a Reply

Your email address will not be published. Required fields are marked *