3 ms·
Why not implement a program that reads from stdin, strips any ansi color, and writes to stdout?
by numbsafari 3y ago
Why not implement a program that reads from stdin, strips any ansi color, and writes to stdout?
- taftster 3y agoInteractive programs wouldn't work very well with this idea. And then you're what, stuck with always piping through some anti-color application each time too? Seems cumbersome.
- hnlmorg 3y agoThose problems are solvable with a PTY. Like how ‘screen’ and ‘tmux’ work. I already have some code in my own shell to wrap everything in a PTY (ironically to add colour: highlight stderr in red) but I could just as easily do the opposite and strip all colour escape sequences.
- deleted 3y ago[deleted]
- aidenn0 3y agoMost programs disable color output when piped, so just piping to cat already accomplishes this.