Skip to main content

brush_interactive/
options.rs

1/// Options for a shell user interface.
2#[derive(Default, bon::Builder)]
3pub struct UIOptions {
4    /// Whether to disable bracketed paste mode.
5    #[builder(default)]
6    pub disable_bracketed_paste: bool,
7    /// Whether to disable color.
8    #[builder(default)]
9    pub disable_color: bool,
10    /// Whether to disable syntax highlighting.
11    #[builder(default)]
12    pub disable_highlighting: bool,
13    /// Whether to enable terminal integration.
14    #[builder(default)]
15    pub terminal_shell_integration: bool,
16    /// Whether to enable zsh-style hooks.
17    #[builder(default)]
18    pub zsh_style_hooks: bool,
19}
20
21impl From<&UIOptions> for crate::InteractiveOptions {
22    fn from(options: &UIOptions) -> Self {
23        Self {
24            terminal_shell_integration: options.terminal_shell_integration,
25            run_cmd_exec_funcs: options.zsh_style_hooks,
26            ..Default::default()
27        }
28    }
29}