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

How to opt out from "Fit lines to terminal height"? #51

Open
carljohnson93 opened this issue Mar 6, 2021 · 1 comment
Open

How to opt out from "Fit lines to terminal height"? #51

carljohnson93 opened this issue Mar 6, 2021 · 1 comment

Comments

@carljohnson93
Copy link

It makes absolutely no sense to not display data that I need to display, I mean any information; User must be able to reach it by scrolling, it really makes no sense, so please tell me is there a way to disable that "feature" and log all I need to and not only what this library allows to?

@ehaynes99
Copy link

It absolutely does makes sense. Scrollback is not a feature of terminals; it's a feature of terminal emulators. This is an important distinction. Whatever app you run to "get a terminal" has its own custom implementation of logic to retain previous output and give you a means to view it (scroll, search, etc.). This is an important distinction, because from the perspective of the terminal, that area doesn't exist. Thus, a library like this one that updates terminal text can't update those lines; it would merely spew a bunch of random intermediate state into the scrollback

E.g. if your terminal is 2 lines tall, and you're trying to update 4 lines:

  • 4 lines would be written, but 2 of them would be pushed "off screen" and captured by your emulator
  • on the next update, it would replace 2 lines with 4, pushing 2 more out of bounds
  • rinse & repeat for all updates

Say you were incrementally adding 3 dots to each line, the editor's scrollback would look like:

first
second
first.
second.
first..
second..
first...
second...
third...       # <-- visible area starts here
fourth...

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

No branches or pull requests

2 participants