configs  Check-in [34edc39a9a]

Overview
Comment:zshrc: Check if --color is supported by ls & grep
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 34edc39a9a214d75906e2ccf4c9700dc066056e5ce96745983ab631fdc1c222d
User & Date: js on 2020-05-26 20:05:20
Other Links: manifest | tags
Context
2020-05-28
23:17
Prefer Fossil branch over Git branch in prompt check-in: 7348743dfc user: js tags: trunk
2020-05-26
20:05
zshrc: Check if --color is supported by ls & grep check-in: 34edc39a9a user: js tags: trunk
2020-05-25
20:32
fish_prompt: Redirect fossil's stderr to /dev/null check-in: 46ef6bc803 user: js tags: trunk
Changes

Modified zshrc from [4cbda25673] to [fe781ffd61].

45
46
47
48
49
50
51

52

53
54
55
56
57
58
59

60

61
62
63
64
65
66
67
	which "$1" &>/dev/null && echo "$1" || echo "$2"
}

if [ -n "$grep" -o -n "$grep_color" ]; then
	: ${grep:=$(__find_command ggrep grep)}
	[ -n "$grep_color" -a "$grep_color[1]" != - ] &&
		grep_color="--color=$grep_color"

	alias grep="$grep $grep_color"

fi
alias fgrep="grep -F"

if [ -n "$ls" -o -n "$ls_color" ]; then
	: ${ls:=$(__find_command gls ls)}
	[ -n "$ls_color" -a "$ls_color[1]" != - ] &&
		ls_color="--color=$ls_color"

	alias ls="$ls $ls_color"

fi
[ "$ls_on_cd" = yes ] && chpwd() { ls }
[ "$ls_on_init" = yes ] && ls

case $TERM_PROGRAM in
	Apple_Terminal)
		__update_terminal_cwd() {







>
|
>







>
|
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
	which "$1" &>/dev/null && echo "$1" || echo "$2"
}

if [ -n "$grep" -o -n "$grep_color" ]; then
	: ${grep:=$(__find_command ggrep grep)}
	[ -n "$grep_color" -a "$grep_color[1]" != - ] &&
		grep_color="--color=$grep_color"
	if echo x | $grep $grep_color x &>/dev/null; then
		alias grep="$grep $grep_color"
	fi
fi
alias fgrep="grep -F"

if [ -n "$ls" -o -n "$ls_color" ]; then
	: ${ls:=$(__find_command gls ls)}
	[ -n "$ls_color" -a "$ls_color[1]" != - ] &&
		ls_color="--color=$ls_color"
	if $ls $ls_color &>/dev/null; then
		alias ls="$ls $ls_color"
	fi
fi
[ "$ls_on_cd" = yes ] && chpwd() { ls }
[ "$ls_on_init" = yes ] && ls

case $TERM_PROGRAM in
	Apple_Terminal)
		__update_terminal_cwd() {