Skip to content

[Bug]: Touchpad scroll triggers shell history navigation instead of scrolling terminal output #3077

@eudu

Description

@eudu

Version: 0.14.3 (202603122332)
OS: macOS Sequoia 15.5
Shell: zsh

Describe the bug

When scrolling with the touchpad in an idle terminal (at the shell prompt, no program running), scroll events are injected into the PTY as up/down arrow key escape sequences (^[[A / ^[[B). This causes the shell to cycle through command history instead of scrolling the terminal scrollback buffer.

This is a regression — it did not happen in earlier versions.

Steps to reproduce

  1. Open a terminal block
  2. Make sure the shell is idle at the prompt (no program running)
  3. Scroll up or down using the touchpad

Expected behavior

Scrolling the touchpad should scroll the terminal scrollback buffer.

Actual behavior

The shell cycles through command history as if the up/down arrow keys were being pressed.

Proof

Running cat -v at the prompt and scrolling with the touchpad produces:

^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A

These are raw ESC[A (cursor up) and ESC[B (cursor down) sequences being written directly into the PTY - identical to what keyboard arrow keys produce. The terminal is not intercepting scroll events before they reach the shell.

Suspected cause

This appears to be a regression introduced in v0.14.1 with the "Claude Code Scroll Fix" (PR #2956), which changed scroll handling behavior in the terminal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions