Skip to content

Conversation

karenetheridge
Copy link

@karenetheridge karenetheridge commented Sep 3, 2025

It's been driving me crazy that prove -l t/mytest.t doesn't use the terminal size to calculate the table size. I dug in and found the place where it was skipping getting the size.

I'm open to how this could be tested in a platform-agnostic way -- I thought about piping stdin and stdout through cat, or forking a subprocess that simply echoed everything it received. I'm not sure what's possible that's MSWin32-friendly.

@exodist
Copy link
Owner

exodist commented Sep 19, 2025

This was intentional behavior, though I am open to the intentional behavior being wrong.

Basically if someone is writing to the terminal, then we know we can query for size. But if the output is not a terminal then it could be a text file, a pipe to another program, something like a web feed, jenkins running a job, It might be headless, etc.

In such cases it is not possible to know how many columns the output can display, so the table defaults to 80 as a recognized (though extremely old) default width to assume.

The tables become extremely unreadable if they are wider than the number of columns, they also become unreadable if they are large and you only have 80 columns, but I think they are slightly more readable at 80 columns then they are spilling off the screen and wrapping.

Maybe a wider default assuming that most people today have more than 80 columns would make sense. Maybe we ignore the fact that we do not know what the other end actually has and just ask the pipe for a width? Open to suggestions for better behavior here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants