I’m looking for inspiration for a custom Bash prompt[1]. I’d love to see yours! 😊 If possible, include both the prompt’s PS1
, and a screenshot/example of what it looks like.
References
- Type: Documentation. Title: “Bash Reference Manual”. Publisher: Gnu Project. Edition: 5.2. Published: 2022-09-19. Accessed: 2025-03-21T02:46Z. URI: https://www.gnu.org/software/bash/manual/html_node/index.html.
- §6.9 “Controlling the Prompt”. URI: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html.
Crossposts:
My bash prompt is just me copying the prompt I have set on fish.
# Prompt green=$'\e[38;5;2m' bright_red=$'\e[38;5;9m' bright_green=$'\e[38;5;10m' reset=$'\e[0m' prompt_command() { local exit_status=$? if [[ $exit_status != 0 ]]; then exit_color=$bright_red exit_prompt=" [$exit_status]" else exit_color=$bright_green exit_prompt="" fi } PROMPT_COMMAND=prompt_command PS1='\[$green\]\w\[$exit_color\]$exit_prompt\n❯ \[$reset\]'
I have a small issue with this prompt though. Sometimes the ❯ ends up turning white for some reason.