Option not to clear terminal when output height larger than the screen #621
rafalglowacz
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I have a command that sometimes makes use of the entire screen width and height. I can limit the output by checking
process.stdout.rows
(andcols
) but apparently I can't react quickly enough when the terminal size changes, for instance when using window splitting in Kitty. So inevitably I'm running into the issue described here:#382 Terminal history cleared if output is greater than height of terminal window
The thing is that my command's users can live with a little defective output. I also compared it to
docker compose pull
which downloads Docker images for many services and it dynamically updates many lines with progress information. It tries to make sure everything fits on the screen, but if I resize its terminal window, it produces some borked output for a moment and then everything goes back to normal. The bad output stays there after the command is done, but it's not a big deal.I tried commenting out the block where Ink clears the screen when
outputHeight >= this.options.stdout.rows
and it worked just like with Docker Compose, some glitches for a moment and then everything back to normal.I think It's a valid use case for some applications and there could be an option to disable clearing scrollback at the cost of potential glitches (with a warning in the documentation). I'm not yet familiar with Ink's code, but if current contributors aren't too enthusiastic about this use case, I can work on it. Would you be interested in a PR, @vadimdemedes?
Beta Was this translation helpful? Give feedback.
All reactions