rustyline-async
rustyline-async copied to clipboard
Line wrapping print glitch
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();
}
}
https://github.com/zyansheep/rustyline-async/assets/24969682/c70c06af-a1c5-451b-9e7f-3e2824353a53
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 :)