From 8aa22cd2553f8c8b824ff37ee98b10eb860806a2 Mon Sep 17 00:00:00 2001 From: nntrivi2001 Date: Wed, 19 Aug 2026 10:05:18 +0700 Subject: [PATCH] fix(run): enable tmux mouse mode so the run terminal's scrollbar actually drags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Session panes had a scrollbar track but no way to drag it — wheel/drag events passed straight to the running program instead of entering tmux's copy-mode scrollback. xterm.js already forwards mouse-tracking escapes once tmux advertises them, so turning mouse mode on per-session is enough. --- server/__tests__/tmux.test.js | 1 + server/lib/tmux.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/server/__tests__/tmux.test.js b/server/__tests__/tmux.test.js index 951fc23..146bcdf 100644 --- a/server/__tests__/tmux.test.js +++ b/server/__tests__/tmux.test.js @@ -47,6 +47,7 @@ describe("tmux wrapper", () => { "--model", "opus", ]); + assert.deepEqual(calls[1], ["set-option", "-t", "ccam-lane-1", "mouse", "on"]); }); it("killSession never throws when the session is already gone", () => { diff --git a/server/lib/tmux.js b/server/lib/tmux.js index 9f1336c..b6fe237 100644 --- a/server/lib/tmux.js +++ b/server/lib/tmux.js @@ -40,6 +40,11 @@ function hasSession(name) { */ function newSession({ name, cwd, argv }) { execImpl(["new-session", "-d", "-s", name, "-c", cwd, "--", ...argv]); + // Without this the pane has no scrollbar/drag scroll at all — wheel events + // just pass through to the running program instead of entering tmux's own + // copy-mode scrollback. xterm.js forwards tmux's mouse-tracking escapes + // automatically once mouse mode is on, so no client-side change is needed. + execImpl(["set-option", "-t", name, "mouse", "on"]); } /**