diff --git a/.config/zsh/autoload/git/glog b/.config/zsh/autoload/git/glog index de9ce30..4ff65d7 100755 --- a/.config/zsh/autoload/git/glog +++ b/.config/zsh/autoload/git/glog @@ -127,7 +127,12 @@ else ) fi -# Display the commits in the above format and pipe that into fzf. -git log "$formatshort" "$dateshort" --color=always "$@" \ -| env LESS="$LESS${LESS:+ }-+F" fzf "${fzf_args[@]}" +# Display the commits in the above format and pipe that into fzf if stdout is a +# terminal. +if [ -t 1 ]; then + git log "$formatshort" "$dateshort" --color=always "$@" \ + | env LESS="$LESS${LESS:+ }-+F" fzf "${fzf_args[@]}" +else + git log "$formatshort" "$dateshort" --color=always "$@" +fi return 0