From 6aa29447272a19ca526e4832fad367143723bb2e Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Wed, 8 Feb 2012 16:40:26 -0800 Subject: [PATCH] Added: hide/show cursor for `git-effort(1)` since it looks really funny otherwise --- bin/git-effort | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bin/git-effort b/bin/git-effort index 593ae33..4c4901d 100755 --- a/bin/git-effort +++ b/bin/git-effort @@ -12,6 +12,24 @@ date() { git log --pretty='format: %ai' $1 | cut -d ' ' -f 2 } +# +# hide cursor +# + +hide_cursor() { + printf '\033[?25l' +} + +# +# show cursor +# + +show_cursor() { + printf '\033[?25h' + printf '\033[m\n' + exit 1 +} + # # get active days for the given # @@ -42,6 +60,11 @@ color_for() { test "$1" = "--above" && above=$2 +# hide cursor + +hide_cursor +trap show_cursor INT + # heading echo @@ -67,3 +90,5 @@ for file in $files; do printf "\033[${color}m %d\033[0m\n" $active done echo + +show_cursor \ No newline at end of file