Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upNo usable output or panic when not outputting to a terminal #13
Comments
Peltoche
added
the
bug
label
Dec 5, 2018
This comment has been minimized.
This comment has been minimized.
|
Hello @yannleretaille, Thanks for the report! The terminal_size trick seem a good idea. It think it will be easier to refactor the color package into a struct before. |
Peltoche
closed this
in
#17
Dec 5, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yannleretaille commentedDec 5, 2018
Example 1
Expected behavior: properly pipe contents to next program, expecting infinite width (e.g. "0")
Example 2
Test now contains a lot of unprintable characters, e.g. it looks like this:
Expected behavior: don't print escape/color codes when not outputting to a terminal
Proposed solution
terminal_size()at program startup and cache the result.None, disable color formatting for all outputsNone, either set a reasonable default width for text files inprint_gridor just default toprint_one_per_lineinstead