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

Line wrapping print glitch #20

Open
manforowicz opened this issue Oct 1, 2023 · 1 comment
Open

Line wrapping print glitch #20

manforowicz opened this issue Oct 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@manforowicz
Copy link
Contributor

After pressing enter on a wrapped line, it looks as if the line content prints twice (with some visual glitches).

I'm using rustyline-async version 0.4.0 on Linux. Here's the example code I used to demonstrate this issue:

use rustyline_async::{Readline, ReadlineEvent};
use std::io::Write;

#[async_std::main]
async fn main() {
    let (mut readline, mut printer) = Readline::new("> ".to_string()).unwrap();
    
    while let ReadlineEvent::Line(text) = readline.readline().await.unwrap() {
        readline.add_history_entry(text.to_string());
        writeln!(printer, "Hi there!").unwrap();
    }
}
long-line-glitch.mp4
@zyansheep
Copy link
Owner

Strange, seems like the lines are only getting partially cleared. I don't have the time to look at it right now, but I'd be happy to merge any PRs.
Or if you want commit perms to develop directly on the main branch that's fine to :)

@zyansheep zyansheep added the bug Something isn't working label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants