Skip to content

Instantly share code, notes, and snippets.

@lostvikx
Created February 7, 2023 13:14
Show Gist options
  • Save lostvikx/f71b8c7d27baeda675058e152c7d8cbe to your computer and use it in GitHub Desktop.
Save lostvikx/f71b8c7d27baeda675058e152c7d8cbe to your computer and use it in GitHub Desktop.
A custom minimal bash prompt.
# \W: Current dir
# \w: Path from home dir
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[\033[00m\]\[\033[01;34m\][\w]\[\033[00m\] \$ '
else
PS1='${debian_chroot:+($debian_chroot)}\W \$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u: \w\a\]$PS1"
;;
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment