mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
fix(colorize): support args when input is stdin (#11038)
Co-authored-by: August Feng <au.fengster@gmail.com>
This commit is contained in:
parent
f1764f8a56
commit
47767bd03c
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue