Bash Prompts and the "Bash Prompt HOWTO"

Introduction

Many years ago, I was the maintainer of the Bash Prompt HOWTO. There are several reasons I haven't updated it:

  • it's a big document: revising the whole thing takes a long time (I know - I started several times)
  • I hate the DocBook format they (The Linux Documentation Project) preferred
  • the document, despite its age, is still surprisingly accurate and complete: Bash has gone from version 3 to 5 in the intervening couple decades, but this has had only very small effects on prompt handling
  • The Linux Documentation Project has fallen badly out of favour: under "recently updated" I find the last updated document was in 2015, so posting a document there is of dubious value

I suppose what this adds up to is that I could use any document format I liked, and post on my own website ... but changing document format is also painful. <sigh>

In the mean time, I've continued to revise my own Bash Prompts. I posted an unsuccessful GitHub project. The idea is sound: componentize Bash Prompts so someone can quickly construct their own prompt - and I do use it myself, but it's complex and for those who didn't write it ... it's probably a major PITA. That and other projects - failed (Bashish) and ongoing (Starship) have made it clear that it's very hard to make constructing prompts easy. And no matter how much you wrap this stuff up in scripts and configuration to make it easier, the configuration will still require a lot of reading and people will still want to do things that your configuration system doesn't even allow. All of which comes back to ... write your own. Which has a big learning curve, but I'll document some of it here. And maybe someday I'll even update and re-assemble the HOWTO.