aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-client
diff options
context:
space:
mode:
Diffstat (limited to 'crates/atuin-client')
-rw-r--r--crates/atuin-client/config.toml16
-rw-r--r--crates/atuin-client/src/settings.rs28
2 files changed, 44 insertions, 0 deletions
diff --git a/crates/atuin-client/config.toml b/crates/atuin-client/config.toml
index 94f4a180..69cfea84 100644
--- a/crates/atuin-client/config.toml
+++ b/crates/atuin-client/config.toml
@@ -296,6 +296,22 @@ records = true
## Default filter mode can be overridden with the filter_mode setting.
# filters = [ "global", "host", "session", "session-preload", "workspace", "directory" ]
+[tmux]
+## Enable using atuin with tmux popup (requires tmux >= 3.2)
+## When enabled and running inside tmux, Atuin will use a popup window for interactive search.
+## Set to false to disable the popup.
+## This can also be controlled with the ATUIN_TMUX_POPUP environment variable.
+## Note: tmux popup is currently supported in zsh, bash, and fish shells.
+# enabled = true
+
+## Width of the tmux popup window
+## Can be a percentage, or integer (e.g. "100" means 100 characters wide)
+# width = "80%"
+
+## Height of the tmux popup window
+## Can be a percentage, or integer (e.g. "100" means 100 lines tall)
+# height = "60%"
+
[ui]
## Columns to display in the interactive search, from left to right.
## The selection indicator (" > ") is always shown first implicitly.
diff --git a/crates/atuin-client/src/settings.rs b/crates/atuin-client/src/settings.rs
index d0e0ae2f..d849e816 100644
--- a/crates/atuin-client/src/settings.rs
+++ b/crates/atuin-client/src/settings.rs
@@ -393,6 +393,18 @@ pub struct Search {
pub filters: Vec<FilterMode>,
}
+#[derive(Clone, Debug, Deserialize, Serialize)]
+pub struct Tmux {
+ /// Enable using atuin with tmux popup (tmux >= 3.2)
+ pub enabled: bool,
+
+ /// Width of the tmux popup (percentage)
+ pub width: String,
+
+ /// Height of the tmux popup (percentage)
+ pub height: String,
+}
+
impl Default for Preview {
fn default() -> Self {
Self {
@@ -438,6 +450,16 @@ impl Default for Search {
}
}
+impl Default for Tmux {
+ fn default() -> Self {
+ Self {
+ enabled: true,
+ width: "80%".to_string(),
+ height: "60%".to_string(),
+ }
+ }
+}
+
// The preview height strategy also takes max_preview_height into account.
#[derive(Clone, Debug, Deserialize, Copy, PartialEq, Eq, ValueEnum, Serialize)]
pub enum PreviewStrategy {
@@ -720,6 +742,9 @@ pub struct Settings {
#[serde(default)]
pub kv: kv::Settings,
+
+ #[serde(default)]
+ pub tmux: Tmux,
}
impl Settings {
@@ -1040,6 +1065,9 @@ impl Settings {
)?
.set_default("theme.name", "default")?
.set_default("theme.debug", None::<bool>)?
+ .set_default("tmux.enabled", true)?
+ .set_default("tmux.width", "80%")?
+ .set_default("tmux.height", "60%")?
.set_default(
"prefers_reduced_motion",
std::env::var("NO_MOTION")