Severity: MEDIUM Status: ✅ RESOLVED
When mouse tracking is enabled (mouse = on), mouse wheel events (.scroll_up and .scroll_down) on an active pane that does not claim raw SGR mouse reporting (wants_mouse == false) unconditionally enter szn’s copy-mode:
// src/server/server.zig:1894-1905
} else {
handled = true;
if (m.button == .scroll_up) {
if (active_pane.screen.copy_mode) |*target_cm| {
target_cm.scroll_offset = @min(target_cm.scroll_offset + 3, @as(u32, @intCast(active_pane.screen.grid.historyLen())));
} else {
active_pane.enterCopyMode() catch |err| std.log.warn("enterCopyMode failed: {any}", .{err});
if (active_pane.screen.copy_mode) |*target_cm| {
target_cm.scroll_offset = @min(3, @as(u32, @intCast(active_pane.screen.grid.historyLen())));
}
self.dirty = true;
}
active_pane.dirty = true;
}
}
When running an interactive CLI or full-screen TUI tool (antigravity-cli, opencode, vim, less, man, nano) that runs in the Alternate Screen (ESC [ ? 1049 h / mode.alt_screen == true):
historyLen() == 0). Scrolling the wheel enters copy-mode with zero history or reveals stale text from before the program was launched.q or Enter is explicitly pressed.tmux)In standard tmux, the default mouse wheel binding (WheelUpPane / WheelDownPane) inspects whether the alternate screen is active via #{alternate_on}:
alternate_on == true): tmux sends 3x Up/Down arrow key sequences (\x1b[A / \x1b[B or \x1bOA / \x1bOB depending on DECCKM keypad cursor mode) directly to the application PTY so the application scrolls its internal buffer.alternate_on == false): tmux enters copy-mode to scroll through terminal history.In src/server/server.zig:1894, check active_pane.screen.mode.alt_screen:
alt_screen is active and !wants_mouse: synthesize and write Up/Down cursor escape sequences (\x1bOA or \x1b[A for wheel-up, \x1bOB or \x1b[B for wheel-down) via active_pane.writeInput().alt_screen is false: retain the existing enterCopyMode() scrollback navigation.