aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-client/src/settings.rs
diff options
context:
space:
mode:
authorKkoi <79646021+lmBored@users.noreply.github.com>2026-01-28 22:08:41 +0100
committerGitHub <noreply@github.com>2026-01-28 13:08:41 -0800
commit1fef7508186a755bc1e0c651a4815167848f19ec (patch)
tree5627908157f0b8079030f7ef3fa7d5890ca4b447 /crates/atuin-client/src/settings.rs
parentfix: new session on shlvl change (#3111) (diff)
downloadatuin-1fef7508186a755bc1e0c651a4815167848f19ec.zip
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>
Diffstat (limited to 'crates/atuin-client/src/settings.rs')
-rw-r--r--crates/atuin-client/src/settings.rs28
1 files changed, 28 insertions, 0 deletions
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")