idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.72k stars 1.04k forks source link

Better - terminal width aware - postprocessor console table output #22856

Open dschwen opened 1 year ago

dschwen commented 1 year ago

Reason

With a lot of PPs being output on the console, or with a small terminal size, the output is rather unreadable.

Design

Query the terminal size with ioctl(STDOUT_FILENO, TIOCGWINSZ, &size); and split the table, ensuring each chunk fits the terminal width.

Impact

Better output readability.

dschwen commented 1 year ago

Hm, there already is FormattedTable::getTermWidth....

ok

[console]
  type = Console
  fit_mode = AUTO
[]

should already do what I want.

dschwen commented 1 year ago

except it doesn't. I'll investigate further

dschwen commented 1 year ago

export MOOSE_PPS_WIDTH=xxx does right thing. I'd still like AUTO to work though.

dschwen commented 1 year ago

AUTO would IMO be a better default for terminals

GiudGiud commented 1 year ago

wow this does wonders on SAM inputs on the VTB. https://github.com/idaholab/virtual_test_bed/tree/devel/htgr/mhtgr/mhtgr_sam

I m all in for AUTO default

GiudGiud commented 1 year ago

Is the fix in https://github.com/idaholab/moose/pull/23752 good enough to close this?

It does: default is environment variable, if not set try AUTO. AUTO fails often, default to 132.