feat: add --headless flag for unattended operation

This commit is contained in:
2026-07-27 17:17:56 -06:00
parent af5c34fde5
commit f1415067f2
5 changed files with 162 additions and 1 deletions
+2
View File
@@ -33,6 +33,7 @@ use fuzzy_matcher::{FuzzyMatcher, skim::SkimMatcherV2};
use is_terminal::IsTerminal;
use nu_ansi_term::Color;
use std::borrow::Cow;
use std::sync::atomic::AtomicBool;
use std::sync::{LazyLock, OnceLock};
use std::{cmp, env, path::PathBuf, process};
use syntect::highlighting::{Highlighter, Theme};
@@ -43,6 +44,7 @@ pub static CODE_BLOCK_RE: LazyLock<Regex> =
pub static THINK_TAG_RE: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"(?s)^\s*<think>.*?</think>(\s*|$)").unwrap());
pub static IS_STDOUT_TERMINAL: LazyLock<bool> = LazyLock::new(|| std::io::stdout().is_terminal());
pub static HEADLESS: AtomicBool = AtomicBool::new(false);
pub static NO_COLOR: LazyLock<bool> = LazyLock::new(|| {
env::var("NO_COLOR")
.ok()