fix(terminal): enable zellij mouse mode so wheel scroll works#363
Open
i-trytoohard wants to merge 1 commit into
Open
fix(terminal): enable zellij mouse mode so wheel scroll works#363i-trytoohard wants to merge 1 commit into
i-trytoohard wants to merge 1 commit into
Conversation
Terminal scroll was completely dead. The frontend configures xterm.js with scrollback: 0 because zellij owns scrollback in the alt-screen buffer, but the backend passed --mouse-mode false to every zellij attach (embeddedClientOptions). With mouse tracking off, zellij never enabled SGR mouse mode — wheel events reached neither xterm (no local buffer) nor zellij (no tracking), falling into a void. Set --mouse-mode true so zellij intercepts wheel events and scrolls its own scrollback. Text selection still works via shift-drag, which xterm.js bypasses through mouse tracking by default. Introduced in #325 (5e8c8de) when client options were extracted into embeddedClientOptions().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Terminal scroll is completely dead — scrolling the wheel does nothing.
Root cause
The terminal runs
zellij attachin the alternate screen buffer. The frontend setsscrollback: 0on xterm.js (XtermTerminal.tsx) because zellij owns scrollback — there is no local buffer to fall back on.But the backend passed
--mouse-mode falseinembeddedClientOptions()(commands.go:86), applied to both session creation and every per-client attach. With mouse tracking off, zellij never enables SGR mouse mode. Wheel events reach:scrollback: 0)Wheel events fall into a void.
Introduced in #325 (
5e8c8de) when client options were extracted intoembeddedClientOptions(). The integration test even documented the decision: "Mouse reporting is deliberately disabled."Fix
Set
--mouse-mode true. Zellij now enables SGR mouse tracking on attach, so wheel events reach zellij and scroll its internal scrollback.Text selection still works — xterm.js bypasses mouse tracking for shift-drag by default.
Changes
backend/.../zellij/commands.go--mouse-mode false→true+ explanatory commentbackend/.../zellij/zellij_test.gobackend/.../terminal/attachment_integration_test.gofrontend/.../XtermTerminal.tsxTesting
go test ./internal/adapters/runtime/zellij/✓go test ./internal/terminal/✓go test ./...) — all 36 packages pass, zero regressions