cl-ansi-text
cl-ansi-text copied to clipboard
Add "tty-p" command to allow analysis
https://twitter.com/jschauma/status/309781450398507010
"Unix tool writers: it'd be swell if you could not print ^[[0;33color code^[[0m escape sequences if output does not in fact go to a tty."
This indicates that a TTY-P needs to be implemented to allow library users to not output ansi-codes if they do not want to.
OSX 10.8 tty
command has this definition:
The tty utility exits 0 if the standard input is a terminal, 1 if the standard input is not a terminal, and >1 if an error occurs.
Adding external-program
as a dependency and invoking tty
should gather the requisite information.
Interestingly, running (external-program:run "tty") on a non-SLIME Linux SBCL 1.1.4 informs me that it's not a tty.
However, this same environment renders to the user's screen and interprets the ANSI codes quite well.
I'm not sure, but you can also try interactive-stream-p
.
@mrkkrp H'm! I'll have to give that a spin.