Skip to content

Commit 431ab02

Browse files
Auto-respawn tmux pane on SIGINT instead of showing "Pane is dead"
Adds a pane-died hook that catches exit status 130 (SIGINT/Ctrl-C) and respawns a fresh shell, preventing the confusing "Pane is dead" message. Other non-zero exits are still preserved for debugging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 31703dc commit 431ab02

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

scripts/sinteractive

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ function start_tmux {
488488
$TMUX_BIN -L "$sock" set-option -t "$session_name" set-clipboard on
489489
# Keep panes open on non-zero exit for debugging (tmux >= 3.4)
490490
$TMUX_BIN -L "$sock" set-option -t "$session_name" remain-on-exit failed
491+
# Auto-respawn pane on Ctrl-C / SIGINT (exit 130) instead of "Pane is dead"
492+
$TMUX_BIN -L "$sock" set-hook -t "$session_name" pane-died \
493+
"if -F '#{==:#{pane_dead_status},130}' 'respawn-pane -k'"
491494
# Highlight windows with new activity
492495
$TMUX_BIN -L "$sock" set-option -t "$session_name" monitor-activity on
493496
# Auto-rename windows to current command

0 commit comments

Comments
 (0)