Set preview background color: [Dark | Light]
You can use the following bash keywords in any "Text" component. See `man bash` for a more complete list:
\u The name of the logged-in user
\h The hostname up to the first '.'
\H The full hostname
\$ Shows a $ for a regular user or # for root user
\\ A literal backslash "\" character
Unlike other prompt generating tools that insert ANSI escape sequences to set colors for your
prompt, this one uses the bash \[$(...)\] sequence to use the tput
command to set the colors. This means that bash has a more accurate internal idea of how long
your prompt is, so that word wrapping for example behaves correctly as you enter a long command.
How to Use
You'll construct a custom bash prompt by using the Components builder above. The components are
processed in order, so for example if you have a "Set color -> red" followed by text, that text
will be displayed in red in your bash prompt.
look so far. It has built-in support for handling common bash keywords such as \u and \h, but it
won't process more complicated ones. The final output for your .bashrc file will be
shown in the "Result" box that you can paste into your .bashrc.
Starting a new bash shell after saving the changes should show your new bash prompt.
Select a theme preset from the dropdown above the component builder to select an example theme,
and study how it was pieced together.
Noah Petherbridge, www.kirsle.net.
This is "Version 2.0" of my $PS1 generator, updated to use Knockout.js
and have more features. My older version that doesn't rely on any external JS libraries is still
available here: ps1-10.html.
Code last updated on April 25, 2014.