stynx-code 3.6.2

stynx-code — interactive AI coding assistant
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::io::{self, BufRead, Write};

use super::{BOLD, DIM, RESET};

pub fn prompt_resume() -> bool {
    eprint!("  {DIM}Previous session found. Resume? {RESET}{BOLD}[y/n]{RESET} ");
    io::stderr().flush().ok();
    let stdin = io::stdin();
    let mut line = String::new();
    if stdin.lock().read_line(&mut line).is_ok() {
        return line.trim().starts_with('y');
    }
    false
}