Skip to content

Vim mouse click not forwarded to the child process #155

Description

@bastien-gallay

What

Mouse clicks (and drag/motion) are never forwarded to the child process, so
mouse-mode apps like vim / less can't position the cursor on click.\n\n## Root cause\n\nOnly wheel notches are encoded to the PTY — wheel_bytes\n(crates/pty/src/lib.rs:834) handles SGR/X10 wheel reporting and\nalternate-scroll. Button press/release/drag/motion are not encoded at all:\na left-press is consumed locally for text selection\n(crates/app/src/shell/terminal.rs:182-244) and never reaches the child. So an\napp that enabled mouse reporting (MOUSE_REPORT_CLICK / SGR_MOUSE in\nTermMode) gets wheel events but no clicks.\n\n## Fix direction\n\n- Add a button/motion SGR encoder next to wheel_bytes.\n- Gate on the app's mouse-reporting mode: when the child has mouse\n reporting on, forward click/drag to the PTY and bypass local text selection;\n when off, keep the current local-selection behaviour.\n- Carry click coordinates through a new command/event path\n (ScrollTarget/Event plumbing in crates/core/src/app.rs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:terminalPTY, grille, sélection, souris, scrollback, OSC, images

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions