Don't rely on tput
This commit is contained in:
parent
245e331014
commit
cf67c7ae47
3 changed files with 9 additions and 9 deletions
6
zshrc
6
zshrc
|
@ -230,9 +230,9 @@ __has_command tmux && alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf"
|
|||
|
||||
if ! __has_command colordiff; then
|
||||
colordiff() {
|
||||
red="$(tput setaf 1)"
|
||||
green="$(tput setaf 2)"
|
||||
reset="$(tput sgr0)"
|
||||
local red=$(printf "\033[31m")
|
||||
local green=$(printf "\033[32m")
|
||||
local reset=$(printf "\033[0m")
|
||||
sed "s/^+.*$/$green&$reset/" | sed "s/^-.*$/$red&$reset/"
|
||||
}
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue