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

Looser coupling with vt100 #150

Closed
chris-olszewski opened this issue Mar 1, 2024 · 2 comments
Closed

Looser coupling with vt100 #150

chris-olszewski opened this issue Mar 1, 2024 · 2 comments

Comments

@chris-olszewski
Copy link
Contributor

First off thanks for the wonderful library!

I'm curious about how you would feel about allowing users to use alternative terminal emulation libraries.

I think the interface would boil down to something along the lines of:

pub trait Screen {
    type C: Cell;

    fn cell(&self, row: u16, col: u16) -> Option<&Self::C>;
    fn hide_cursor(&self) -> bool;
    fn cursor_position(&self) -> (u16, u16);
}

pub trait Cell {
    fn contents(&self) -> Option<String>;
    fn apply(&self, cell: &mut ratatui::buffer::Cell);
}

This would be a breaking change due to PseudoTerminal::screen returning vt100::Screen

Background:
I'm hitting some of the scrollback issues and have some other functionality I want to add. I'd love to use tui-term with my forked vt100 while I wait for the changes to land upstream without forking tui-term as well.

I'd be more than happy to throw together a PR if that would be helpful.

@a-kenji
Copy link
Owner

a-kenji commented Mar 1, 2024

Thank you for reaching out!
This sounds like a good idea to me.

This would be a breaking change due to PseudoTerminal::screen returning vt100::Screen

That sounds fine in the current stage of the project.

Id be happy to look over a PR, so we can discuss specifics.

@a-kenji
Copy link
Owner

a-kenji commented Mar 28, 2024

Thank you for the contribution, and the thoughtful sketches.

#152 is now in the currently released version v0.1.9.0.

@a-kenji a-kenji closed this as completed Mar 28, 2024
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