Note: The Listed platform will permanently shut down December 31, 2026. Your data published on Listed will still be available in your personal Standard Notes account. Learn more

Custom Bash Prompt

Prompt

function set_ps1 {
    export PS1="\n\033[4m\u@\h:\w $(git branch 2>/dev/null | grep '*')\033[0m\n$ "
}
export PROMPT_COMMAND=set_ps1

Meanings of tokens of the prompt above:

  • \n — New line
  • \033[4m — Start of underline
  • \033[0m — End of underline
  • \u — Username
  • \h — Host name
  • \w — Working directory (full path)

You'll only receive email when they publish something new.

More from Arno
All posts