summaryrefslogtreecommitdiffstats
path: root/src/render/repl.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-10-31 06:14:39 +0800
committerGitHub <noreply@github.com>2023-10-31 06:14:39 +0800
commit86fd9d207e780931f8dc152bf90387de481fb3ee (patch)
treebe31b9fee280c48791379bf39d84cfd480402ff8 /src/render/repl.rs
parenteb023e57592eae1d1672136790fd4c028a6d8712 (diff)
downloadaichat-86fd9d207e780931f8dc152bf90387de481fb3ee.tar.gz
fix: no last newline in reply text on windows os (#185)
Diffstat (limited to 'src/render/repl.rs')
-rw-r--r--src/render/repl.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/render/repl.rs b/src/render/repl.rs
index f65ff1d..d55c1c1 100644
--- a/src/render/repl.rs
+++ b/src/render/repl.rs
@@ -95,7 +95,11 @@ fn repl_render_stream_inner(
writer.flush()?;
}
ReplyStreamEvent::Done => {
- queue!(writer, style::Print("\n"))?;
+ #[cfg(target_os = "windows")]
+ let eol = "\n\n";
+ #[cfg(not(target_os = "windows"))]
+ let eol = "\n";
+ queue!(writer, style::Print(eol))?;
writer.flush()?;
break;