summaryrefslogtreecommitdiff
path: root/xterm256lut_gen.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2024-07-04 11:44:47 +0200
committerjaseg <git@jaseg.de>2024-07-04 11:45:58 +0200
commitf2c26ed7a72828f94f174ab8c84676856fbe2097 (patch)
tree27780539d70c0b843ef1434d0d608fb391f11393 /xterm256lut_gen.py
parentdc3ddf395017bf903f5bfb8f0c5c6d08d84fcdc0 (diff)
downloadlolcat-f2c26ed7a72828f94f174ab8c84676856fbe2097.tar.gz
lolcat-f2c26ed7a72828f94f174ab8c84676856fbe2097.tar.bz2
lolcat-f2c26ed7a72828f94f174ab8c84676856fbe2097.zip
Make lolcat interleave nicely with non-colored stderr
This works by making lolcat always reset the color at the end of a line on its input, and only setting a new color immediately before printing the first character on the next line. This way, assuming that whatever process is piped into lolcat follow the standard convention where stdout is buffered line-wise, and only writes full lines to stderr, a process that outputs to both stdout and stderr but that has only stdout piped through lolcat (as most people would do) would have it's stderr output interleave nicely uncolored with the lolcat-colored stdout output. This won't always work, but it gets us most of the way there with little effort and negligible (2 extra escape sequences per line of output) performance overhead. Thanks to github user @kolayne for reporting this as an issue!
Diffstat (limited to 'xterm256lut_gen.py')
0 files changed, 0 insertions, 0 deletions