15
Share your Bash prompts! (sh.itjust.works)
submitted 1 year ago* (last edited 1 year ago) by Kalcifer@sh.itjust.works to c/linux@programming.dev

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

  1. 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.

Crossposts:

all 8 comments
sorted by: hot top new old
[-] muntedcrocodile@lemm.ee 5 points 1 year ago
[-] quincunx@lemm.ee 3 points 1 year ago
[-] muntedcrocodile@lemm.ee 3 points 1 year ago

U can fish on any Linux distro. Most major distros have binaries but those that don't u can easily build it with cargo.

Tldr yes.

[-] DmMacniel@feddit.org 2 points 1 year ago

Same, it's just more friendly:)

[-] sxan@midwest.social 2 points 1 year ago

Not Bash, but zsh.

The host is there only because I'm usually logged in to 7 machines at once. The right prompt is the bare minimum path context, and the command # for easier !-re-execute; it disappears if the command gets long enough.

There's a bare minimum of cruft; no 2-line prompts, minimum verbosity in the prompt itself, because it's otherwise just noise that interferes with the output of whatever I'm doing and takes up space. It's especially important if I'm logged in via termux on my phone or something, where space is at a premium. What am I saying? Space is always at a premium.

$PS1 is

%{$fg[green]%}%m %{$fg[blue]%}»%{$reset_color%}

$RPROMPT is

%{$fg[green]%}%(5~|%-1~/…/%3~|%4~) %{$fg[yellow]%}%h%{$reset_color%}
[-] chris@lemmy.grey.fail 2 points 1 year ago
[-] Kissaki@programming.dev 2 points 1 year ago

I'm usually not using bash locally, and remotely don't change the prompt, but Starship works in bash too.

I use Nushell with Starship (cross platform prompt) in Windows Terminal.

~
nu ❯                                  took 52ms

Path above prompt, prompt with shell name and a character, and on the right side how long the previous command took. The Character changes color from green to red when the last command exited with a non-0/-success exit code.

In a git repo folder it shows git info too - the branch symbol won't show here because here is not a nerd font with symbols; I'll add a screenshot:

C:\dev\dotnet\meercat-monitor on  main [?]
nu ❯                                                                took 1ms 

Starship can show a bunch of status/state information for various tools, package managers, docker, etc.

I wouldn't show my PROMPT_COMMAND, but it's a nu closure so not really comparable to bash. But as I said, Starship works with Bash too.

this post was submitted on 22 Mar 2025
15 points (89.5% liked)

Linux

14914 readers
428 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 3 years ago
MODERATORS