cl-ansi-text icon indicating copy to clipboard operation
cl-ansi-text copied to clipboard

Add "tty-p" command to allow analysis

Open pnathan opened this issue 11 years ago • 3 comments

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.

pnathan avatar Mar 09 '13 20:03 pnathan

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.

pnathan avatar Mar 10 '13 06:03 pnathan

I'm not sure, but you can also try interactive-stream-p.

mrkkrp avatar Jan 07 '15 19:01 mrkkrp

@mrkkrp H'm! I'll have to give that a spin.

pnathan avatar Jan 10 '15 08:01 pnathan