From 6e203584509aaee89bde3e202d2b1c43998e2039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20B=C4=99dkowski?= Date: Sun, 26 Nov 2023 14:12:01 +0100 Subject: [PATCH] fix: tmux: ignore session without id, add missing name It's very unlikely do happen. --- kupfer/plugin/tmux.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kupfer/plugin/tmux.py b/kupfer/plugin/tmux.py index 5d248094..cb27d0eb 100644 --- a/kupfer/plugin/tmux.py +++ b/kupfer/plugin/tmux.py @@ -59,12 +59,16 @@ def tmux_sessions( if libtmux: if srv := libtmux.Server(): # type: ignore for sess in srv.sessions: + if not sess.session_id: + continue + yield ( sess.session_id, - sess.session_name, - sess.session_attached, - sess.session_created, + sess.session_name or f"session {sess.session_id}", + sess.session_attached or "", + sess.session_created or "", ) + return # fallback