File size: 1,805 Bytes
49a519f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | /// 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,
}
|