From 1fef7508186a755bc1e0c651a4815167848f19ec Mon Sep 17 00:00:00 2001 From: Kkoi <79646021+lmBored@users.noreply.github.com> Date: Wed, 28 Jan 2026 22:08:41 +0100 Subject: feat: add option to use tmux display-popup (#3058) This is a "continuation" of #1177 - which was a draft that used FIFOs (named pipes) to get output from the popup, however this causes popup not being closed properly, so in this PR I use tmpfile to store the result and read after popup closes. @ellie could you review this PR please? P.S. Thank you @immae for sharing your idea! ## Feature + Option to use tmux popup window in `config.toml` + Customize window width/height in `config.toml` + Tmux display-popup for `zsh, bash, fish` ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- crates/atuin-client/src/settings.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'crates/atuin-client/src') 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, } +#[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::)? + .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") -- cgit v1.3.1