summaryrefslogtreecommitdiff
path: root/plugins/colorize/colorize.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/colorize/colorize.plugin.zsh')
-rw-r--r--plugins/colorize/colorize.plugin.zsh6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh
index 12841e0ee..c49acd864 100644
--- a/plugins/colorize/colorize.plugin.zsh
+++ b/plugins/colorize/colorize.plugin.zsh
@@ -42,12 +42,12 @@ colorize_cat() {
ZSH_COLORIZE_STYLE="emacs"
fi
- # Use stdin if no arguments have been passed.
- if [ $# -eq 0 ]; then
+ # Use stdin if stdin is not attached to a terminal.
+ if [ ! -t 0 ]; then
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g
else
- chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}"
+ chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}" "$@"
fi
return $?
fi