aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client
diff options
context:
space:
mode:
authorHelmut K. C. Tessarek <tessarek@evermeet.cx>2024-04-18 11:16:54 -0400
committerGitHub <noreply@github.com>2024-04-18 16:16:54 +0100
commit176eae02f7f855ef40a4461caca61d530486113f (patch)
tree14cbe3b9e30d00997036816fbdb5aac2b0e1567c /atuin-client
parentfeat: allow ignoring failed commands (#1957) (diff)
downloadatuin-176eae02f7f855ef40a4461caca61d530486113f.zip
feat: show preview auto (#1804)
* feat: show preview auto * refactor: preview_auto
Diffstat (limited to 'atuin-client')
-rw-r--r--atuin-client/config.toml5
-rw-r--r--atuin-client/src/settings.rs2
2 files changed, 7 insertions, 0 deletions
diff --git a/atuin-client/config.toml b/atuin-client/config.toml
index 254586a5..415fd441 100644
--- a/atuin-client/config.toml
+++ b/atuin-client/config.toml
@@ -73,6 +73,11 @@
## useful when the command is longer than the terminal width and is cut off
# show_preview = false
+## enable or disable automatic preview. It shows a preview, if the command is
+## longer than the width of the terminal. It respects max_preview_height.
+## (default: true)
+# show_preview_auto = true
+
## what to do when the escape key is pressed when searching
## possible values: return-original, return-query
# exit_mode = "return-original"
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs
index 035af321..daf8fe34 100644
--- a/atuin-client/src/settings.rs
+++ b/atuin-client/src/settings.rs
@@ -358,6 +358,7 @@ pub struct Settings {
pub inline_height: u16,
pub invert: bool,
pub show_preview: bool,
+ pub show_preview_auto: bool,
pub max_preview_height: u16,
pub show_help: bool,
pub show_tabs: bool,
@@ -615,6 +616,7 @@ impl Settings {
.set_default("style", "auto")?
.set_default("inline_height", 0)?
.set_default("show_preview", false)?
+ .set_default("show_preview_auto", true)?
.set_default("max_preview_height", 4)?
.set_default("show_help", true)?
.set_default("show_tabs", true)?