I do a lot of my work in a virtual machine running Red Hat Enterprise Linux. In order to distinguish the terminal windows that are running shells within the VM from the ones running on my laptop's natively, I configure the shell prompt to look different.

For my other systems, I use my punctual prompt system, but for this VM I thought it would be more fun to have something a bit more on-brand.

A Red Hat prompt

Here's a bashrc snippet to achieve this:

hat="🎩"
export PS1="\[\e[31m\]$hat\[\e[0m\]"

I ended up switching to zsh for my shell in this VM because of a bash bug exposed by trying this out. You shouldn't hit it for the snippet above, but I originally specified the red colour using 256 color escape codes, and this caused width-error bugs when long lines wrapped. zsh doesn't have the same bug, but it can be avoided in bash anyway by using the much older 8 colour escape codes, as above.


Comments

comment 1
As an aside, whether this will look good, or not, depends a lot on what font you are using. If anyone can tell me how I reliably tell from which font my hat glyph is being pulled, please do: my terminal font is "Noto Sans Regular", but I strongly suspect this glyph lives elsewhere.
jon,
comment 2

As I read this on planet debian, here's something more Debianish:

swirl="🍥"
export PS1="\[\e[31m\]$swirl\[\e[0m\]"
Comment by Mark,
comment 2
Now we need a Debian Swirl UTF-8 char :)
Comment by Paulo Thiago Santa,
comment 4
I think it would be great if there was a unicode glyph for a swirl that could be used for Debian. That one Mark suggests is not too bad (U+1F365 FISH CAKE WITH SWIRL DESIGN) but it would be nice if there was a better one ☺
jon,
comment 5
Awesome! One issue is that for me the hat is completely different. I think you are right that the glyphs come from somewhere else because changing font to what you have didn't help :/
Comment by Alexander,
comment 6
It turns out this particular glyph has come from "overpass-mono"
jon,