유대선
프로젝트로
·트러블슈팅·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.

AI 버전

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

  • click-to-copy features we'd just built — I even wrote that caveat — and shipped it anyway.

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:

  • The option lives on the long-lived server. set -g mouse on is set on the -L dalkkak tmux server, which survives app restarts. Reverting the code that sets it does nothing to a running server — it kept mouse mode on until I explicitly ran set -g mouse off on it.
  • Runtime mode ≠ the option. The focused pane had entered copy-mode from scrolling (#{pane_in_mode} = 1, confirmed via list-panes). Turning the mouse option off does not exit copy-mode — the pane stayed frozen mid-scroll. I had to send-keys -X cancel it.

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).

리뷰 필요

내 시각이 아직 안 들어간 entry.