This is an automated email from the git hooks/post-receive script.

git pushed a commit to reference refs/pull/29/head
in repository terminology.

View the commit online.

commit d6a5e92cbf89f9dc61376e9a1c3fff179e236517
Author: [email protected] <[email protected]>
AuthorDate: Fri Mar 20 21:06:54 2026 -0600

    fix: provide interactive shell fallback when detaching from tmux/screen
    
    When users detach from a tmux or screen session during restoration,
    the PTY was closing instead of providing an interactive shell prompt.
    This improvement appends "; exec \"\$SHELL\"" to the mux attach
    commands so the terminal remains usable after detachment or if the
    multiplexer binary is not found.
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---
 src/bin/session.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/bin/session.c b/src/bin/session.c
index fe585074..a537eef8 100644
--- a/src/bin/session.c
+++ b/src/bin/session.c
@@ -666,6 +666,9 @@ _session_file_free(Session_File *sf)
 }
 
 /* Returns a malloc'd command string or NULL for plain shell.
+ * The command appends "; exec \"$SHELL\"" after the mux attach so that when
+ * the user detaches (or the mux binary is not found), the PTY falls back to an
+ * interactive shell rather than closing the terminal widget.
  * Caller must free(). */
 static char *
 _build_mux_cmd(const Session_Node *solo)
@@ -686,14 +689,14 @@ _build_mux_cmd(const Session_Node *solo)
    if (!strcmp(solo->mux_type, "tmux"))
      {
         int n = snprintf(buf, sizeof(buf),
-                         "tmux new-session -A -s %s", solo->mux_session);
+                         "tmux new-session -A -s %s; exec \"${SHELL:-/bin/sh}\"", solo->mux_session);
         if (n < 0 || (size_t)n >= sizeof(buf)) return NULL;
         return strdup(buf);
      }
    else if (!strcmp(solo->mux_type, "screen"))
      {
         int n = snprintf(buf, sizeof(buf),
-                         "screen -R %s", solo->mux_session);
+                         "screen -R %s; exec \"${SHELL:-/bin/sh}\"", solo->mux_session);
         if (n < 0 || (size_t)n >= sizeof(buf)) return NULL;
         return strdup(buf);
      }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to