Skip to content

Line wrapping print glitch #20

@manforowicz

Description

@manforowicz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions