From 10ef8f8cad56fcba9f07bd60a2aac8d70b71002e Mon Sep 17 00:00:00 2001
From: Chris Coley <chris@codingallnight.com>
Date: Tue, 3 Jul 2018 01:45:31 -0700
Subject: [PATCH] Clean up the PS1_PRE and PS1_POST declarations
---
bashrc | 13 +++++--------
bashrc.local.example | 2 +-
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/bashrc b/bashrc
index e9664c6..1b84fbf 100644
--- a/bashrc
+++ b/bashrc
@@ -51,19 +51,16 @@ fi
if [ "$color_prompt" = yes ] && [ "`id -u`" -eq 0 ]; then
# Red prompt for root
-# PS1='${debian_chroot:+($debian_chroot)}\h:\[\033[31m\][\w]\[\033[00m\] \$ '
- PS1_PRE='${debian_chroot:+($debian_chroot)}\h:\[\033[31m\][\w]\[\033[00m\]'
- PS1_POST=' \$ '
- PS1="$PS1_PRE$PS1_POST"
+ PS1_PRE='${debian_chroot:+($debian_chroot)}\u@\h:\[\033[31m\][\w]\[\033[0m\]'
else
# Default prompt for everyone else
-# PS1='${debian_chroot:+($debian_chroot)}\h:\[\033[38;5;25m\][\w]\[\033[00m\] \$ '
- PS1_PRE='${debian_chroot:+($debian_chroot)}\h:\[\033[38;5;25m\][\w]\[\033[00m\]'
- PS1_POST=' \$ '
- PS1="$PS1_PRE$PS1_POST"
+ PS1_PRE='${debian_chroot:+($debian_chroot)}\u@\h:\[\033[34m\][\w]\[\033[0m\]'
fi
unset color_prompt force_color_prompt
+PS1_POST=' \$ '
+PS1="$PS1_PRE$PS1_POST"
+
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
diff --git a/bashrc.local.example b/bashrc.local.example
index d4e62ce..80ae4fc 100644
--- a/bashrc.local.example
+++ b/bashrc.local.example
@@ -14,7 +14,7 @@ if [ -f ~/.git-prompt.sh ]; then
fi
if [ -z ${PS1_PRE+x} ] && [ -z ${PS1_POST+x} ]; then
- PS1_PRE='${debian_chroot:+($debian_chroot)}\h:\[\033[38;5;25m\][\w]\[\033[00m\]'
+ PS1_PRE='${debian_chroot:+($debian_chroot)}\u@\h:\[\033[34m\][\w]\[\033[0m\]'
PS1_POST=' \$ '
fi
--
GitLab