zshrc: Make colordiff fallback work on MSYS2
This commit is contained in:
parent
9ea5a40c70
commit
7f64e66c17
1 changed files with 5 additions and 4 deletions
9
zshrc
9
zshrc
|
@ -210,10 +210,11 @@ if which fossil &>/dev/null; then
|
|||
if which colordiff &>/dev/null; then
|
||||
fossil diff -N "$@" | colordiff | less -FRX
|
||||
else
|
||||
fossil diff -N "$@" |
|
||||
sed "s/^+.*$/$(tput setaf 2)&$(tput sgr0)/" |
|
||||
sed "s/^-.*$/$(tput setaf 1)&$(tput sgr0)/" |
|
||||
less -FRX
|
||||
red="$(tput setaf 1)"
|
||||
green="$(tput setaf 2)"
|
||||
reset="$(tput sgr0)"
|
||||
fossil diff -N "$@" | sed "s/^+.*$/$green&$reset/" |
|
||||
sed "s/^-.*$/$red&$reset/" | less -FRX
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue