From 908a3733288f2d987b4f679d0b9a4304018c395a Mon Sep 17 00:00:00 2001 From: alexg0 Date: Mon, 30 Nov 2009 04:47:39 +0800 Subject: Fixed errors related to running git-prompt.sh in Emacs shell-mode, change prompt-char to '#' when root, allowed changing prompt-char (eg. $) when user. Added Emacs backup (*~) files as .gitignore. 1. tput colors was being concatinated to '0'. Inside emacs shell this is not valid, as `tput colors` is 0. 2. MC bug check was catching Emacs shell inferior mode. Now checking for $INSIDE_EMACS variable. 3. Defined $prompt_char variable and $root_prompt_char variable. Defaulting $root_prompt_char to '#'. Can just use \$, which automatically changes between '$' and '#', but that would change defalt behavior. 4. Fixed typo in a comment (cmd_cmd -> cwd_cmd). --- git-prompt.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'git-prompt.conf') diff --git a/git-prompt.conf b/git-prompt.conf index c4706c9..bdae7d5 100644 --- a/git-prompt.conf +++ b/git-prompt.conf @@ -46,7 +46,8 @@ ### directory, exit code, root color -# if [ 0`tput colors` -ge 8 ]; then # if terminal supports colors +# cols=`tput colors` +# if [[ -n "$cols" && $cols -ge 8 ]]; then # if terminal supports colors # dir_color=CYAN # rc_color=red # user_id_color=blue @@ -56,6 +57,10 @@ # rc_color=bw_bold # fi +### prompt character, default '>' for regular user, '#' for root +# prompt_char='>' +## prompt_char='$' +# root_prompt_char='#' ##### Per host color -- cgit v1.2.3