From 26399ed27e357b1bcd1bbd47182fcc474ebb52e9 Mon Sep 17 00:00:00 2001 From: Dan Bravender Date: Tue, 3 Aug 2010 11:25:48 +0800 Subject: My TERM is xterm-256color even under screen for some reason --- git-prompt.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index f951623..3b8cc4c 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -220,22 +220,25 @@ set_shell_label() { # FIXME $STY not inherited though "su -" [ "$STY" ] && screen -S $STY -X title "$*" } + if [[ -n "$STY" ]]; then + screen_label "$*" + else + case $TERM in - case $TERM in + screen*) + screen_label "$*" + ;; - screen*) - screen_label "$*" - ;; - - xterm* | rxvt* | gnome-terminal | konsole | eterm | wterm ) - # is there a capability which we can to test - # for "set term title-bar" and its escapes? - xterm_label "$plain_who_where $@" - ;; + xterm* | rxvt* | gnome-terminal | konsole | eterm | wterm ) + # is there a capability which we can to test + # for "set term title-bar" and its escapes? + xterm_label "$plain_who_where $@" + ;; - *) - ;; - esac + *) + ;; + esac + fi } export -f set_shell_label -- cgit v1.2.3 From 06a20ea0cf53246a140af7863bd3906c2a18ef28 Mon Sep 17 00:00:00 2001 From: Robert Wahler Date: Mon, 29 Nov 2010 23:59:21 +0800 Subject: unset tty on cygwin under console2 --- git-prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-prompt.sh b/git-prompt.sh index 3b8cc4c..21f3610 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -264,7 +264,7 @@ set_shell_label() { # we don't need tty name under X11 case $TERM in - xterm* | rxvt* | gnome-terminal | konsole | eterm | wterm ) unset tty ;; + xterm* | rxvt* | gnome-terminal | konsole | eterm | wterm | cygwin) unset tty ;; *);; esac -- cgit v1.2.3 From 8d45f1fc7acdedc21d6ad141b281ecdd19a859ea Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Sat, 29 Jan 2011 15:29:51 +0200 Subject: removed bash completion for git-prompt bash git completion can be enabled from .bash_profile. Put something following in your profile: [[ -f "/etc/bash_completion.d/git" ]] && . /etc/bash_completion.d/git [[ -f "/usr/share/bash-completion/git" ]] && . /usr/share/bash-completion/git --- git-prompt.sh | 20 +------------------- index.txt | 10 ---------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 21f3610..021000f 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -15,6 +15,7 @@ conf=~/.config/git-prompt.conf; [[ -r $conf ]] && . $conf unset conf + ##### set defaults if not set git_module=${git_module:-on} @@ -384,24 +385,6 @@ parse_hg_status() { } -parse_git_complete() { - if [ "${BASH_VERSION%.*}" \< "3.0" ]; then - # echo "You will need to upgrade 'bash' to version 3.0 \ - # for full programmable completion features (bash complete) \ - # Please install bash-completion packet like: $ yum -y install bash-completion" - return - fi - - complete -f -W "$( - echo `git branch -a | sed -e s/[\ \*]//g | cut -f 1 -d ' ' | uniq`; \ - echo `git remote | sed -e s/[\ \*]//g | cut -f 1 -d ' ' | uniq`; \ - echo `git | tail -23 | head -21 | cut -d ' ' -f 4`; \ - echo '--help'; \ - echo '--staged'; \ - echo 'remote'; \ - echo 'help'; \ - )" g git -} parse_git_status() { @@ -414,7 +397,6 @@ parse_git_status() { [[ -n ${git_dir/./} ]] || return 1 vcs=git - parse_git_complete ########################################################## GIT STATUS file_regex='\([^/]*\/\{0,1\}\).*' diff --git a/index.txt b/index.txt index d8dd50b..ab786ba 100644 --- a/index.txt +++ b/index.txt @@ -87,16 +87,6 @@ j .*3 # same as cd "~/long dir mp3" ------------- -== Bash Completion - -Completion can be done for git subcommands, branches and remotes: - ---------------------- -git ch # expands to git checkout -git checkout ma # expands to git checkout master --------------------- - - == Install Download link:git-prompt.sh[] or get it with GIT: -- cgit v1.2.3