Skip to content

Grow read-only terminal window with output instead of scrolling off #4923

Answered by jerch
tobijk asked this question in Q&A
Discussion options

You must be logged in to vote

Is there a straight-forward way to do that?

Short answer - nope. The size concept is so crucial & deeply woven into terminals, that you always would have to go with term.resize, which itself triggers alot of follow-up code to do state updates and inform the backend about the resize. This is always cumbersome and costly. It is also the reason why it should not occur over and over, it is meant to be exceptional from user interaction. To still do it automatically from incoming data, maybe see https://stackoverflow.com/a/73005790/12548337.

Idk what your exact use case looks like, but what shall happen for 10000+ lines of output? Browser OOM due to an overly big canvas in height?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tobijk
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants