How to add an icon to the bash prompt

前端 未结 6 836
予麋鹿
予麋鹿 2021-02-04 16:09

I know you can edit the bash prompt permanently by editing the PS1 variable in your ~/.bashrc file, mine looks like this:

PS1=\"\\[\\e[0;31m\\]

        
6条回答
  •  生来不讨喜
    2021-02-04 16:38

    Actually, Yes, you can.

    In recent versions of Bash, at least 4 (i could do it in 4.2 and 4.3), you can render emoji with the hex.

    Use the echo -e flag.

    paste an emoji you looked up in and do a hexdump to see what it's made of:

    plasmarob ~ $ echo -n "

提交回复
热议问题