Skip to content

Instantly share code, notes, and snippets.

@zunda
Created August 5, 2014 10:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zunda/c7c96d083970258b16fa to your computer and use it in GitHub Desktop.
Save zunda/c7c96d083970258b16fa to your computer and use it in GitHub Desktop.
OSXでプロンプトを表示するたびにGItブランチ名をしゃべる。うるさいし遅い。
--- git-prompt.sh.orig 2014-08-04 23:48:33.000000000 -1000
+++ git-prompt.sh 2014-08-05 00:02:38.000000000 -1000
@@ -439,7 +439,8 @@
fi
local f="$w$i$s$u"
- local gitstring="$c${b##refs/heads/}${f:+$z$f}$r$p"
+ local branchname=${b##refs/heads/}
+ local gitstring="$c$branchname${f:+$z$f}$r$p"
if [ $pcmode = yes ]; then
if [ "${__git_printf_supports_v-}" != yes ]; then
@@ -451,4 +452,5 @@
else
printf -- "$printf_format" "$gitstring"
fi
+ say $branchname &
}
@zunda
Copy link
Author

zunda commented Aug 5, 2014

rcファイルの中だと?関数定義の中だと?バックグラウンドに持っていく「&」が効かないようだ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment