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

Is it possible to keep original scrollback buffer intact? #67

Closed
sewbacca opened this issue May 15, 2024 · 1 comment
Closed

Is it possible to keep original scrollback buffer intact? #67

sewbacca opened this issue May 15, 2024 · 1 comment

Comments

@sewbacca
Copy link

I'd like to write a shell like application with autocompletion, so I will only ever have write to the buffer downwards the terminal, meaning I won't be needing to reread the scrollback buffer. Is it possible to keep the original scrollback buffer intact, while still capturing i/o events?
Also to be able to do something meaningful with it, I would probably benefit from an get_cursor function or relative cursor jumps.

@adsr
Copy link
Contributor

adsr commented May 17, 2024

If I understand correctly, you're interested functionality similar to readline. termbox doesn't support this, and I think it's too different of a use-case to include in the API. A built-in assumption of termbox is that you'll be controlling the contents of the entire terminal. (You can of course use readline in conjunction with termbox, but that won't help you if you don't want to manage scrollback yourself.)

I have thought about writing a readline alternative inspired by termbox. It could benefit from the the same terminfo-parsing and built-in defaults that termbox uses. The API would look different though.

For now I would recommend using something like readline, linenoise, or libedit, or using termbox and managing scrollback yourself.

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