유대선
프로젝트로
·트러블슈팅·2

Chasing wheel-scrollback with tmux mouse mode broke the terminal — and reverting the code didn't undo the live server

Enabling tmux mouse mode to get wheel-scrollback flooded the webview (glitch + lag) and broke copy. The deeper lesson: reverting the CODE didn't reset the running tmux server, and disabling the mouse option didn't exit a pane already stuck in copy-mode.

What I did, and why it was wrong

The user kept asking for wheel-scrollback in the panes. The only way to get it in a tmux pane is tmux mouse mode (set -g mouse on). I knew it traded off with the copy-on-select

Result, verbatim: "파란명령어 클릭은 되는데 그래픽이 깨지고 버벅인다 … 복붙도 안됨." Graphics glitching, lag, copy broken, only the colored-command click surviving.

Why each thing happened (verified, not guessed)

With mouse on, tmux owns the mouse:

  1. Mouse-tracking escape sequences flood the webview on every mouse move → render glitch + lag.
  2. tmux intercepts drag/click → xterm's own selection (copy-on-select) is bypassed, and tmux's OSC52 copy never reached the system clipboard in this WKWebView stack → copy broke.
  3. The colored-command click survived because it's an xterm link resolved at render time, not a mouse-report.

The part that actually bit: code revert ≠ live state

I reverted pty.rs and reinstalled — and it was still broken. Two state traps:

So the fix was three things, not one: revert the code, reset the live server, and cancel the stuck pane's copy-mode.

Lessons (logged in docs/troubleshooting.md)

  1. Never trade a core working feature for one new one — especially blind. I can't see the GUI render; a change I can't see must be additive, not behavior-replacing. Copy worked; I broke it for scrollback that didn't even land.
  2. Server-scoped state outlives the code that set it. A set -g on a persistent tmux server isn't undone by reverting the spawn code; reset the server explicitly.
  3. A mode is not its toggle. Disabling mouse doesn't leave copy-mode; cancel the mode.
  4. Touching the user's live server is a stateful, outward action — say so first. I ran commands against the running tmux without flagging it; that's on me.

Wheel-scrollback is abandoned in this stack. History scrolls via ⌘L (the transcript log view) or tmux copy-mode (⌃B [). Commits: ed971db (the mistake) → cb0ea8f (revert).