Friday, 17 August 2018

Customize Bash Prompt String

  1. Install sexy-bash-prompt
  2. Modifying the prompt symbol ('PROMPT_SYMBOL') in ~/.bash_prompt
    In Bash 4.2+, add the following line at the beginning.
    PROMPT_SYMBOL=$'\u21AA'
    In Bash 4.1 or earlier, add the following line at the beginning.
    PROMPT_SYMBOL=$'\xe2\x86\xaa'
  3. Then source ~/.bash_prompt
  4. UTF8 code for additional symbols may be found at UTF-8 Arrows
  5. Assigning UTF8 code to variables was demonstrated in Awesome symbols and characters in a bash prompt
  6. Hex code for UTF8 symbols can be found through echo ↪ | hexdump -C, for example.

No comments:

Post a Comment