Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the output adapt to terminal size #35

Open
mity opened this issue Jan 11, 2020 · 2 comments
Open

Make the output adapt to terminal size #35

mity opened this issue Jan 11, 2020 · 2 comments
Labels
enhancement good first issue Feasible for new contributors.

Comments

@mity
Copy link
Owner

mity commented Jan 11, 2020

Make the output, especially as generated by the macros TEST_CHECK(), TEST_MSG() and TEST_DUMP(), automatically adapt to the current terminal size, so that it looks good in a reasonably small terminal window but can use effectively more space if the terminal window is big.

This should involve:

  1. Explore what API is available for the purpose on the platform of your choice.
  2. A pre-processor magic to enable the new platform-specific code only on the given platform.
  3. Breaking the long outputs into multiple lines, depending on the width of the terminal.
  4. And still respect the current indentation level, as set via test_line_indent__().
@mity mity added good first issue Feasible for new contributors. enhancement labels Jan 11, 2020
@arr2036
Copy link
Contributor

arr2036 commented Feb 1, 2020

I think this is mostly getenv("COLUMNS") and set a handler for SIGWINCH?

@mity
Copy link
Owner Author

mity commented Feb 1, 2020

Actually, so far I never did anything like that. But yes, I think so. For Unix/Posix platforms, at least.

I am also not sure whether tracking SIGWINCH is worth the added complexity for something of Acutest's nature. Reading $COLUMNS during initialization might be good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Feasible for new contributors.
Projects
None yet
Development

No branches or pull requests

2 participants