fix(run): turn on tmux mouse mode on every attach, not just at session creation
Sessions created before the mouse-on fix landed (or before the server restarted to pick it up) never got the set-option call, so their pane still had no drag/wheel scroll. Moving it into pty-attach's attach() makes it idempotent per-connection instead of once-at-birth.
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
|
||||
*/
|
||||
|
||||
const tmux = require("./tmux");
|
||||
|
||||
const RUN_ID_RE = /^ccam-lane-\d+$/;
|
||||
|
||||
/**
|
||||
@@ -38,6 +40,14 @@ function __setSpawnImpl(fn) {
|
||||
*/
|
||||
function attach(ws, runId, { cols, rows }) {
|
||||
validateRunId(runId);
|
||||
// Retroactively covers sessions started before mouse mode was wired into
|
||||
// newSession (or before a server restart picked that change up) — see
|
||||
// tmux.js's enableMouse.
|
||||
try {
|
||||
tmux.enableMouse(runId);
|
||||
} catch {
|
||||
/* session gone or tmux unavailable — attach below will surface that */
|
||||
}
|
||||
const pty = spawnImpl("tmux", ["attach-session", "-t", runId], {
|
||||
name: "xterm-256color",
|
||||
cols: cols || 80,
|
||||
|
||||
Reference in New Issue
Block a user