spectral / spectral-core /src /config.rs
stevenkhan's picture
Upload spectral-core/src/config.rs
49a519f verified
/// Terminal configuration — matches Ghostty key options where relevant.
#[derive(Clone, Debug)]
pub struct Config {
pub cols: usize,
pub rows: usize,
pub scrollback_limit: usize,
pub font_family: String,
pub font_size: f32,
pub font_thicken: bool,
pub font_thicken_strength: f32,
pub font_feature: Vec<String>,
pub font_variation: Vec<(String, f32)>,
pub adjust_cell_height: Option<f32>,
pub adjust_cell_width: Option<f32>,
pub adjust_font_baseline: Option<f32>,
pub cursor_style: CursorStyle,
pub cursor_blink: bool,
pub foreground_color: u32,
pub background_color: u32,
pub selection_color: u32,
pub mouse_scroll_multiplier: f32,
pub repaint_delay_ms: u32,
pub input_delay_ms: u32,
pub vsync: bool,
pub opacity: f32,
}
impl Default for Config {
fn default() -> Self {
Self {
cols: 80,
rows: 24,
scrollback_limit: 100_000,
font_family: "Iosevka Extended".to_string(),
font_size: 13.0,
font_thicken: false,
font_thicken_strength: 0.5,
font_feature: Vec::new(),
font_variation: Vec::new(),
adjust_cell_height: None,
adjust_cell_width: None,
adjust_font_baseline: None,
cursor_style: CursorStyle::Block,
cursor_blink: true,
foreground_color: 0xFF_E5E5E5,
background_color: 0xFF_000000,
selection_color: 0xFF_264F78,
mouse_scroll_multiplier: 1.0,
repaint_delay_ms: 0,
input_delay_ms: 0,
vsync: false,
opacity: 1.0,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CursorStyle {
Block,
Beam,
Underline,
}