From 18ecc98014ccb0ad9ff70e05083e4101aef850ea Mon Sep 17 00:00:00 2001 From: s3lph Date: Mon, 23 Nov 2020 20:52:38 +0100 Subject: [PATCH] Change example in README to only pygmentize when on a TTY --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b685d8..279a50b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ Put something like this in your shell's config, e.g. `.bashrc`, `.zshrc`, or wha ```bash function dig() { - /usr/bin/dig $@ | pygmentize -xl path/to/dig-lexer.py -Ostyle=monokai + if [[ -t 1 || "$DIG_COLOR" == "always" ]]; then + /usr/bin/dig $@ | pygmentize -F tokenmerge -xl path/to/dig-lexer.py -Ostyle=monokai + else + /usr/bin/dig $@ + fi } ```