From de6c0a7b1f0a2894be8f6290fd04f2fc939b425a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Messing?= Date: Tue, 28 Jul 2026 02:31:13 +0200 Subject: [PATCH] fix: keep a permanent SIGUSR1 listener so resizes cannot kill dmux The client-resized hook sends SIGUSR1, but the only listener lives in a React effect that unregisters on every dialog toggle, leaving the default terminate action to kill the control pane. --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index 6aaf5d2b..1e1a530b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1469,6 +1469,15 @@ class Dmux { process.emit('dmux-external-command-signal' as any); }); + // Handle SIGUSR1, sent by the client-resized tmux hook set up in setupResizeHook(). + // useLayoutManagement does the actual resize work, but it registers its listener inside + // an effect that unregisters on every dialog toggle. Without a permanent listener here, + // a resize arriving in that window hits the default action for SIGUSR1 — terminate — + // and kills the control pane. Node invokes every listener, so this is purely additive. + process.on('SIGUSR1', () => { + LogService.getInstance().debug('Received SIGUSR1 from tmux client-resized hook', 'ResizeDebug'); + }); + // Handle uncaught exceptions and unhandled rejections process.on('uncaughtException', (error) => { console.error('Uncaught exception:', error);