colorant 0.6.1

Per-directory terminal theme switcher with system dark/light mode support
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `colorant reset` — emit OSC sequences resetting fg, bg, cursor, and the
//! 16-color palette to terminal defaults.

use crate::terminal::{osc, utils};
use anyhow::Result;
use std::io::stdout;

pub fn run() -> Result<()> {
    if utils::detect().is_none() {
        return Ok(());
    }

    let mut out = stdout().lock();
    osc::emit_reset(&mut out)?;
    Ok(())
}