diff options
author | Anderson <141751473+digital-cuttlefish@users.noreply.github.com> | 2024-03-01 09:57:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 14:57:18 +0000 |
commit | 9933220dac1e5d3d5799e14923fd6671ec45b2d6 (patch) | |
tree | 60a191f110ceb3b925a8e0d2d8ea7e80b553a5c1 | |
parent | 515f78fa4c0b9fc95e3204ff53c332780a092bc2 (diff) |
feat(ui): Add config setting for showing tabs (#1755)
* Add config setting for showing tabs
* Added semicolon
-rw-r--r-- | atuin-client/config.toml | 3 | ||||
-rw-r--r-- | atuin-client/src/settings.rs | 2 | ||||
-rw-r--r-- | atuin/src/command/client/search/interactive.rs | 5 |
3 files changed, 8 insertions, 2 deletions
diff --git a/atuin-client/config.toml b/atuin-client/config.toml index 307a645a..d5d7f389 100644 --- a/atuin-client/config.toml +++ b/atuin-client/config.toml @@ -122,6 +122,9 @@ ## amount of commands in your history. # show_help = true +## Configure whether or not to show tabs for search and inspect +# show_tabs = true + ## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include ## 1. AWS key id ## 2. Github pat (old and new) diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 9f2afd04..a71091e2 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -354,6 +354,7 @@ pub struct Settings { pub show_preview: bool, pub max_preview_height: u16, pub show_help: bool, + pub show_tabs: bool, pub exit_mode: ExitMode, pub keymap_mode: KeymapMode, pub keymap_mode_shell: KeymapMode, @@ -593,6 +594,7 @@ impl Settings { .set_default("show_preview", false)? .set_default("max_preview_height", 4)? .set_default("show_help", true)? + .set_default("show_tabs", true)? .set_default("invert", false)? .set_default("exit_mode", "return-original")? .set_default("word_jump_mode", "emacs")? diff --git a/atuin/src/command/client/search/interactive.rs b/atuin/src/command/client/search/interactive.rs index 6c306aa9..dbbc08f2 100644 --- a/atuin/src/command/client/search/interactive.rs +++ b/atuin/src/command/client/search/interactive.rs @@ -522,6 +522,7 @@ impl State { 1 }; let show_help = settings.show_help && (!compact || f.size().height > 1); + let show_tabs = settings.show_tabs; let chunks = Layout::default() .direction(Direction::Vertical) .margin(0) @@ -532,13 +533,13 @@ impl State { Constraint::Length(1 + border_size), // input Constraint::Min(1), // results list Constraint::Length(preview_height), // preview - Constraint::Length(1), // tabs + Constraint::Length(if show_tabs { 1 } else { 0 }), // tabs Constraint::Length(if show_help { 1 } else { 0 }), // header (sic) ] } else { [ Constraint::Length(if show_help { 1 } else { 0 }), // header - Constraint::Length(1), // tabs + Constraint::Length(if show_tabs { 1 } else { 0 }), // tabs Constraint::Min(1), // results list Constraint::Length(1 + border_size), // input Constraint::Length(preview_height), // preview |