From 7d563b0951faf2eaac1d6af9ef36bdf5fe522492 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 20 Feb 2010 12:07:55 +0200 Subject: [PATCH] added SUDO_PS1 prompt variable --- README.md | 6 +++++- prompt.sh | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 33ca1ce..0bbc5c2 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,11 @@ Edit your `~/.profile` or `~/.bash_profile` and add the following to the top: export DOTBASH=~/.bash source $DOTBASH/main.sh - PS1="\u@\h \w\[$txtcyn\]\$git_branch\[$txtrst\]\\$ " + export PS1="\u@\h \w\[$txtcyn\]\$git_branch\[$txtrst\]\\$ " + +Optionally, if you want a nice pretty prompt when using `sudo -s`, also add this line: + + export SUDO_PS1="\[$bakred\]\u@\h\[$txtrst\] \w\[$txtcyn\]\$git_branch\[$txtrst\]\\$ " ## Configuring diff --git a/prompt.sh b/prompt.sh index c06a6d8..3a00c4b 100644 --- a/prompt.sh +++ b/prompt.sh @@ -20,4 +20,7 @@ function find_git_branch { PROMPT_COMMAND="find_git_branch; $PROMPT_COMMAND" # Default Git enabled prompt -# PS1="\u@\h \w\[$txtcyn\]\$git_branch\[$txtrst\]\\$ " \ No newline at end of file +# export PS1="\u@\h \w\[$txtcyn\]\$git_branch\[$txtrst\]\\$ " + +# Default Git enabled root prompt (for use with "sudo -s") +# export SUDO_PS1="\[$bakred\]\u@\h\[$txtrst\] \w\[$txtcyn\]\$git_branch\[$txtrst\]\\$ " \ No newline at end of file