MrZaKaRiAGit

Ps1

mrzakaria at Documents $ If you're tired of the default, boring terminal prompt, you can customize it to be more visually appealing and informative. This guide shows a clean prompt — pink username · white "at" · yellow-green directory · $ — for every major shell and OS.

Created: 4/9/2023Last pushed: 6/23/2026
Ps1

Overview

mrzakaria at Documents $ If you're tired of the default, boring terminal prompt, you can customize it to be more visually appealing and informative. This guide shows a clean prompt — pink username · white "at" · yellow-green directory · $ — for every major shell and OS.

Tags & Topics
Shell

PS1 Linux/macOS Terminal Customization

Screenshot

mrzakaria at Documents $

If you're tired of the default, boring terminal prompt, you can customize it to be more visually appealing and informative. This guide shows a clean prompt — pink username · white "at" · yellow-green directory · $ — for every major shell and OS.

Colors used everywhere: 197 = pink (username), 15 = white ("at"), 191 = yellow-green (directory).

Where is the config file?

Shell / OS File
Bash (Debian, Ubuntu, Mint, Kali) ~/.bashrc
Bash (Fedora, RHEL, Arch, openSUSE) ~/.bashrc
Bash (macOS) ~/.bash_profile
Zsh (macOS default, Linux) ~/.zshrc
Fish ~/.config/fish/functions/fish_prompt.fish
PowerShell (Windows) $PROFILE

System-wide bashrc locations (if you'd rather set it globally): /etc/bashrc (Redhat, Fedora) · /etc/bash.bashrc (Debian, Ubuntu, Mint, Kali) · /etc/bash.bashrc.local (Suse, OpenSuse)


1. Bash — Linux (Debian / Ubuntu)

PS1='${debian_chroot:+($debian_chroot)}\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ '

Instructions

  1. Open your config: nano ~/.bashrc
  2. Paste the line below at the bottom (remove any old PS1= line first).
  3. Save (Ctrl+O, Enter) and exit (Ctrl+X).
  4. Apply: source ~/.bashrc

Tokens: \u = username · \W = current folder only (\w = full path) · \e[1;… = bold · \e[38;5;Nm = 256-color text · \e[0m = reset · \[ \] marks invisible characters so line-wrapping stays correct. ${debian_chroot:+…} is Debian/Ubuntu-specific and shows the chroot name when present.

PS1='${debian_chroot:+($debian_chroot)}\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ '

2. Bash — Other Linux (Fedora / RHEL / Arch / openSUSE)

PS1='\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ '

Instructions — same steps as Debian (~/.bashrc → paste → source ~/.bashrc). The only difference: these distros don't set debian_chroot, so that part is dropped. On Arch the file may not exist yet — just create it.

Fedora/RHEL keep their default prompt in /etc/bashrc. Setting PS1 in your personal ~/.bashrc overrides it cleanly — no need to touch system files.

PS1='\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ '

3. Bash — macOS

PS1='\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ '

Instructions

  1. (Optional) switch to bash: chsh -s /bin/bash
  2. macOS reads ~/.bash_profile for login shells: nano ~/.bash_profile
  3. Paste below, save, exit.
  4. Apply: source ~/.bash_profile

Add export BASH_SILENCE_DEPRECATION_WARNING=1 above the line to hide the macOS "bash is deprecated" notice. Works in Terminal.app, iTerm2, Ghostty, Kitty, WezTerm.

export BASH_SILENCE_DEPRECATION_WARNING=1
PS1='\[\e[1;38;5;197m\]\u\[\e[0m\]\[\e[38;5;15m\] at \[\e[1;38;5;191m\]\W\[\e[0m\] \$ '

4. Zsh — macOS (default) & Linux

PROMPT='%B%F{197}%n%f%b%F{15} at %F{191}%1~%f %# '

Instructions

  1. Zsh is the default on macOS (since Catalina) and available on any Linux.
  2. Open config: nano ~/.zshrc
  3. Paste the line below, save, exit.
  4. Apply: source ~/.zshrc

Tokens: %n = username · %1~ = current folder (%~ = full path with ~ for home) · %B/%b = bold on/off · %F{N}/%f = color on/off · %# = # when root, else %. Zsh tracks invisible characters automatically — no \[ \] needed.

PROMPT='%B%F{197}%n%f%b%F{15} at %F{191}%1~%f %# '

5. Fish — Linux & macOS

function fish_prompt
    set_color -o 197; echo -n (whoami)
    set_color 15;     echo -n ' at '
    set_color -o 191; echo -n (basename (pwd))
    set_color normal; echo -n ' $ '
end

Instructions — Fish uses a fish_prompt function, not PS1.

  1. Create the file: nano ~/.config/fish/functions/fish_prompt.fish
  2. Paste the function below.
  3. Save and exit — Fish reloads automatically (open a new prompt to confirm).

Tokens: set_color -o N = bold 256-color · whoami = username · basename (pwd) = current folder · set_color normal = reset.

function fish_prompt
    set_color -o 197; echo -n (whoami)
    set_color 15;     echo -n ' at '
    set_color -o 191; echo -n (basename (pwd))
    set_color normal; echo -n ' $ '
end

6. PowerShell — Windows (and macOS/Linux PS 7+)

function prompt {
    $e = [char]27
    "$e[1;38;5;197m$env:USERNAME$e[0m$e[38;5;15m at " +
    "$e[1;38;5;191m$(Split-Path -Leaf $PWD)$e[0m $ "
}

Instructions

  1. Find your profile path: run $PROFILE.
  2. Create/open it: notepad $PROFILE (click Yes if prompted to create it).
  3. Paste the function below, save, close.
  4. Apply: . $PROFILE (or open a new window).

Requires Windows Terminal or PowerShell 7+ for ANSI colors. $env:USERNAME = user · Split-Path -Leaf $PWD = current folder.

function prompt {
    $e = [char]27
    "$e[1;38;5;197m$env:USERNAME$e[0m$e[38;5;15m at " +
    "$e[1;38;5;191m$(Split-Path -Leaf $PWD)$e[0m $ "
}

7. CMD — Windows

prompt $E[91m%USERNAME%$E[0m at $E[93m$M$E[0m$G

Instructions — CMD has no 256-color or username token, so this uses 16-color codes and %USERNAME%.

  1. Quick test (current window): paste the line and press Enter.
  2. Permanent: regeditHKEY_CURRENT_USER\Software\Microsoft\Command Processor → new String value AutoRun set to the same command.
  3. Colors need Windows 10+ (VT processing, on by default).

Tokens: $E = escape · [91m/[93m = bright red / bright yellow · $M = full path · $G = > sign.

prompt $E[91m%USERNAME%$E[0m at $E[93m$M$E[0m$G

Color cheat sheet (256-color codes)

Code Color Used for
197 Pink username
191 Yellow-green directory
15 White "at" text

Change any number to recolor. Preview all 256 colors on Linux/macOS:

for i in {0..255}; do printf "\e[38;5;${i}m%3d\e[0m " $i; done; echo

Repository Stats

Stars
0
Forks
0
Watchers
0
Size
14 KB
Primary Language
Shell
Issues0 Open

Gallery

Project screenshot 1