Skip to content

Disable mouse reporting on terminal reattach#118

Open
Zeus-Deus wants to merge 1 commit into
Emanuele-web04:mainfrom
Zeus-Deus:feature/39-bug-terminals-inside-threads-print-mouse-escape-sequences
Open

Disable mouse reporting on terminal reattach#118
Zeus-Deus wants to merge 1 commit into
Emanuele-web04:mainfrom
Zeus-Deus:feature/39-bug-terminals-inside-threads-print-mouse-escape-sequences

Conversation

@Zeus-Deus
Copy link
Copy Markdown

Fixes #39.

Restored terminal panes could come back with mouse reporting still on. With no TUI attached to consume the events, moving the mouse printed raw CSI escape sequences into the shell, and reset/stty sane didn't fix it.

The server now appends a mouse-mode reset to the history returned in a terminal snapshot, so it's applied whenever a terminal is opened, reattached, or restored. The web side also clears mouse-tracking modes when replaying a snapshot, since xterm.js doesn't reliably clear them on a full reset. Both sides share one constant for the reset sequence.

Added unit tests for the reattach and restore paths. Also checked it in a running app — after a reconnect and snapshot replay, mouse movement over a restored terminal no longer prints escape sequences.

Restored terminal panes could come back with mouse reporting still on.
With no TUI attached to consume the events, moving the mouse printed raw
CSI escape sequences into the shell, and reset/stty sane didn't fix it.

The server now appends a mouse-mode reset to the history returned in a
terminal snapshot, so it's applied whenever a terminal is opened,
reattached, or restored. The web side also clears mouse-tracking modes
when replaying a snapshot, since xterm.js doesn't reliably clear them on
a full reset.

Added unit tests for the reattach and restore paths.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Terminals inside threads print mouse escape sequences after app restart

1 participant