fix: windows no stream output (#37)

This commit is contained in:
sigoden 2023-03-08 16:17:51 +08:00 committed by GitHub
parent 2a7a6f5f27
commit ee81275431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -32,10 +32,10 @@ pub fn render_stream(
} else {
cmd_render_stream(rx, abort)
};
if let Err(err) = err {
let err = format!("{err:?}");
print_now!("{}\n\n", err.trim());
}
if let Err(err) = err {
let err = format!("{err:?}");
print_now!("{}\n\n", err.trim());
}
drop(wg);
});
ReplyStreamHandler::new(Some(tx), abort_clone)

View File

@ -18,11 +18,9 @@ use unicode_width::UnicodeWidthStr;
pub fn repl_render_stream(rx: Receiver<ReplyStreamEvent>, abort: SharedAbortSignal) -> Result<()> {
enable_raw_mode()?;
let mut stdout = io::stdout();
queue!(stdout, event::DisableMouseCapture)?;
let ret = repl_render_stream_inner(rx, abort, &mut stdout);
queue!(stdout, event::DisableMouseCapture)?;
disable_raw_mode()?;
ret