feat(maestro): default daemon TMUX_TMPDIR to $XDG_RUNTIME_DIR (NAP-234)
ci / rust (push) Failing after 2m13s
ci / rust (push) Failing after 2m13s
Plain `tmux ls` in the user's shell now sees maestro-managed sessions without the `TMUX_TMPDIR=/tmp` workaround, because most shells already set `TMUX_TMPDIR=$XDG_RUNTIME_DIR` and the daemon now matches. Precedence: env `MAESTRO_DAEMON_TMUX_TMPDIR` > `[daemon].tmux_tmpdir` > `dirs::runtime_dir()` > None (tmux's own `/tmp` default). Set `tmux_tmpdir = "/tmp"` in config.toml if the daemon must outlive the user's login without linger enabled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -146,6 +146,14 @@ pub struct DaemonSection {
|
||||
/// `None` ⇒ daemon default (~64 KB); `Some(0)` disables replay.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pty_replay_bytes: Option<usize>,
|
||||
/// `TMUX_TMPDIR` the daemon exports for every `tmux` invocation (NAP-234).
|
||||
/// When unset, the daemon defaults to `$XDG_RUNTIME_DIR` so that bare
|
||||
/// `tmux ls` in a user shell (which usually has the same env var) sees
|
||||
/// maestro sessions. Set to `/tmp` to opt back into tmux's own default —
|
||||
/// useful if the daemon outlives the user's login session and you can't
|
||||
/// enable `loginctl enable-linger`.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub tmux_tmpdir: Option<PathBuf>,
|
||||
/// `[daemon.policy]` — per-daemon attach policy (NAP-247).
|
||||
#[serde(default, skip_serializing_if = "DaemonPolicySection::is_empty")]
|
||||
pub policy: DaemonPolicySection,
|
||||
@@ -162,6 +170,7 @@ impl DaemonSection {
|
||||
&& self.perimeter_id.is_none()
|
||||
&& self.private_addr.is_none()
|
||||
&& self.pty_replay_bytes.is_none()
|
||||
&& self.tmux_tmpdir.is_none()
|
||||
&& self.policy.is_empty()
|
||||
}
|
||||
}
|
||||
@@ -338,6 +347,7 @@ mod tests {
|
||||
perimeter_id: Some("wg-naps62".into()),
|
||||
private_addr: Some("10.0.0.7:7070".into()),
|
||||
pty_replay_bytes: Some(131_072),
|
||||
tmux_tmpdir: Some(PathBuf::from("/run/user/1000")),
|
||||
policy: DaemonPolicySection {
|
||||
allow_inbound: vec!["konishi".into()],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user