How can I properly use an American flag emoji in my bash prompt?
5
votes
1
answer
1271
views
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 user 🗽 ls|
**I get:**
🇺🇸 Desktop user 🗽 ls |
<-*weird space offset of cursor*
**My ~/.bash_profile is:**
export PS1='🇺🇸 \W \u 🗽 '
Asked by Andrew Kirna
(151 rep)
Jan 31, 2019, 01:08 AM
Last activity: May 3, 2022, 10:09 PM
Last activity: May 3, 2022, 10:09 PM