fix: prevent mouse wheel from cycling plan mode options instead of scrolling

Claude's Ink UI enables terminal mouse reporting, causing xterm.js to
forward wheel events to the application. This made scrolling up to read
the plan impossible. Intercept wheel events to always scroll the terminal
viewport directly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkonandClaude Opus 4.5 committed 2026-01-24 19:21:04 +01:00
1 parent b98913e328
commit 3f082c5e01
1 file changed
+8
+8
View File
@@ -466,6 +466,14 @@ class ClaudemanApp {
this.terminal.open(container);
this.fitAddon.fit();
// Always use mouse wheel for terminal scrollback, never forward to application.
// Prevents Claude's Ink UI (plan mode selector) from capturing scroll as option navigation.
this.terminal.attachCustomWheelEventHandler((ev) => {
const lines = Math.round(ev.deltaY / 25) || (ev.deltaY > 0 ? 1 : -1);
this.terminal.scrollLines(lines);
return false;
});
// Welcome message
this.showWelcome();