From adef82a838daeaf8df3ba8bf5b787f32e688a7de Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Sun, 21 Oct 2012 11:20:59 +1300 Subject: [PATCH] export/unset CLICOLOR_FORCE=1 var for ll command --- lib/git/shell_shortcuts.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/git/shell_shortcuts.sh b/lib/git/shell_shortcuts.sh index 72bfb4b..3fe9ff4 100644 --- a/lib/git/shell_shortcuts.sh +++ b/lib/git/shell_shortcuts.sh @@ -82,7 +82,7 @@ if [ "$_uname" = "Linux" ]; then _abs_path_command="readlink -f" elif [ "$_uname" = "Darwin" ]; then # OS X ls commands - _ll_command="CLICOLOR_FORCE=1 ls -l -G" + _ll_command="ls -l -G" _ll_sys_command="ls" # Use perl abs_path, since readlink -f isn't available on OS X _abs_path_command="perl -e 'use Cwd \"abs_path\"; print abs_path(shift)'" @@ -93,6 +93,8 @@ if [ -n "$_ll_command" ]; then # Adds numbered shortcuts to output of ls -l, just like 'git status' unalias ll > /dev/null 2>&1; unset -f ll > /dev/null 2>&1 function ls_with_file_shortcuts { + local OLDCLICOLOR_FORCE="$CLICOLOR_FORCE" + export CLICOLOR_FORCE=1 local ll_output="$($_ll_command "$@")" # Parse path from args @@ -146,6 +148,7 @@ EOF let e++ done IFS="$OLDIFS" + export CLICOLOR_FORCE="$OLDCLICOLOR_FORCE" } fi