Skip to content

Commit 6a4ec78

Browse files
committed
hides cursor during spinner
1 parent 0627285 commit 6a4ec78

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/chat-cli/src/cli/chat/custom_spinner.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ pub struct Spinners {
1818

1919
impl Spinners {
2020
pub fn new(message: String) -> Self {
21+
// Hide the cursor when starting the spinner
22+
let _ = execute!(
23+
std::io::stderr(),
24+
cursor::Hide
25+
);
26+
2127
let pb = ProgressBar::new_spinner();
2228
pb.set_style(
2329
ProgressStyle::default_spinner()
@@ -57,6 +63,7 @@ impl Drop for Spinners {
5763
cursor::MoveToColumn(0),
5864
terminal::Clear(terminal::ClearType::CurrentLine),
5965
style::Print("\n"),
66+
cursor::Show
6067
);
6168
}
6269
}

0 commit comments

Comments
 (0)