You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to control the coloring via an environment variable. My use case is that I have jq running inside wasm-terminal and would like to suppress its ansi_coloring when wasm-terminal detects that jq's input is being piped to another program (WASI's isatty is not supported in the browser).
I know that I can disable coloring via the -M flag but it would mean I have to add a special case in wasm-terminal as opposed to NO_COLOR which is supported by an increasing number of CLI programs.
I am seeing this as well using Acme from plan9port on macOS. Acme's built-in terminal emulator "win" does not support ANSI colors at all, so I use a wrapper script in $HOME/bin/acme to set NO_COLOR=1 FORCE_COLOR=0.
I followed @geirha's advice (thanks!) and made a similar wrapper script for plan9port's rc(1) shell. Sharing below...
#!/usr/local/plan9/bin/rc
# wrapper for jq. disables colors in an acme win.
# make sure to "chmod +x" this file and put it in a directory listed in your $PATH.
if (~ $TERM_PROGRAM 'win') { /usr/local/bin/jq -M $* }
if not { /usr/local/bin/jq $* }
It would be nice to control the coloring via an environment variable. My use case is that I have
jq
running inside wasm-terminal and would like to suppress its ansi_coloring when wasm-terminal detects that jq's input is being piped to another program (WASI'sisatty
is not supported in the browser).I know that I can disable coloring via the
-M
flag but it would mean I have to add a special case in wasm-terminal as opposed toNO_COLOR
which is supported by an increasing number of CLI programs.See https://no-color.org/
The text was updated successfully, but these errors were encountered: