I want to use an American flag emoji in my bash prompt (i.e. PS1 environment variable). However, the American flag emoji causes the terminal cursor to offset an extra character to the right.
πΊπΈ is comprised of two unicode characters, πΊ and πΈ. I believe terminal is converting this to a mono-spaced emoji character (the flag), yet still allocating space for two characters. How can I achieve my expected cursor position?
I want:
πΊπΈ Desktop akirna π½ ls|
I get:
πΊπΈ Desktop akirna π½ ls |
<< weird space offset before cursor
My ~/.bash_profile
is:
export PS1='πΊπΈ \W \u π½ '
export PS1='\[\xf0\x9f\x87\xba\xf0\x9f\x87\xb8\] \W \u π½ '
shows\xf0\x9f\x87\xba\xf0\x9f\x87\xb8 ~ akirna π½
β Semiporcelain\[
can be used for sequences that take no space at all, but everything else is assumed to be 1 for 1. β Finesse\001
and\002
instead of\[
and\]
: unix.stackexchange.com/a/447520/103120 β Overliberalexport PS1="π¦π² $BPurple$gitBranch$BRed$PathShort$NewLine$BBlue$Dollar$Color_Off"
if you want I can provide their values as well β Intemperate