Skip to content

Commit 2ca54cb

Browse files
committed
hide cursor during thinking; increase recursion depth
1 parent 21f8386 commit 2ca54cb

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/repl.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ impl Repl {
9999
match line.to_lowercase().as_str() {
100100
"exit" | "quit" => {
101101
self.save_current_session()?;
102-
println!("{}", "Goodbye!".bright_cyan());
102+
println!("\n{}", "Goodbye!".bright_cyan());
103103
break;
104104
}
105105
"clear" => {
106106
self.conversation.clear();
107107
self.display_messages.clear();
108108
self.session_id = HistoryManager::generate_session_id();
109-
println!("{}", "Conversation history cleared.".bright_yellow());
109+
println!("\n{}\n", "Conversation history cleared.".bright_yellow());
110110
continue;
111111
}
112112
"resume" => {
@@ -193,7 +193,7 @@ impl Repl {
193193
content_blocks: Vec<ContentBlock>,
194194
runtime: &tokio::runtime::Runtime,
195195
) -> Result<()> {
196-
const MAX_RECURSION_DEPTH: u32 = 50;
196+
const MAX_RECURSION_DEPTH: u32 = 500;
197197

198198
if std::env::var("SOFOS_DEBUG").is_ok() {
199199
eprintln!(
@@ -414,6 +414,10 @@ impl Repl {
414414
let frames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
415415
let mut frame_idx = 0;
416416

417+
// Hide cursor
418+
print!("\x1B[?25l");
419+
let _ = io::stdout().flush();
420+
417421
while thinking_clone.load(Ordering::Relaxed) {
418422
print!(
419423
"\r{} {}",
@@ -425,8 +429,9 @@ impl Repl {
425429
thread::sleep(Duration::from_millis(80));
426430
}
427431

428-
// Clear the line
432+
// Clear the line and show cursor
429433
print!("\r{}\r", " ".repeat(20));
434+
print!("\x1B[?25h");
430435
let _ = io::stdout().flush();
431436
});
432437

0 commit comments

Comments
 (0)