From 7f64e66c17b936df2d552000f04f659b031ba22d Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sun, 24 May 2020 13:30:32 +0000 Subject: [PATCH] zshrc: Make colordiff fallback work on MSYS2 --- zshrc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zshrc b/zshrc index 872b6d1..a0b5248 100644 --- a/zshrc +++ b/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