Skip to main content

pawan/config/
tui.rs

1use serde::{Deserialize, Serialize};
2
3/// Configuration for the TUI
4#[derive(Debug, Clone, Serialize, Deserialize)]
5#[serde(default)]
6pub struct TuiConfig {
7    /// Enable syntax highlighting
8    pub syntax_highlighting: bool,
9
10    /// Theme for syntax highlighting
11    pub theme: String,
12
13    /// Show line numbers in code blocks
14    pub line_numbers: bool,
15
16    /// Enable mouse support
17    pub mouse_support: bool,
18
19    /// Scroll speed (lines per scroll event)
20    pub scroll_speed: usize,
21
22    /// Maximum history entries to keep
23    pub max_history: usize,
24
25    /// Auto-save enabled (default: true)
26    pub auto_save_enabled: bool,
27    /// Auto-save interval in minutes
28    pub auto_save_interval_minutes: u32,
29    /// Custom save directory for auto-saves (defaults to ~/.pawan/sessions/)
30    pub auto_save_dir: Option<std::path::PathBuf>,
31}
32
33impl Default for TuiConfig {
34    fn default() -> Self {
35        Self {
36            syntax_highlighting: true,
37            theme: "base16-ocean.dark".to_string(),
38            line_numbers: true,
39            mouse_support: true,
40            scroll_speed: 3,
41            max_history: 1000,
42            auto_save_enabled: true,
43            auto_save_interval_minutes: 5,
44            auto_save_dir: None,
45        }
46    }
47}