Skip to content

Mouse tracking state not reset on exit (/exit) #38860

Closed

Description

@kraso

Description

When exiting opencode using the /exit command, raw SGR mouse tracking escape sequences are printed to the terminal instead of being properly cleaned up.

Terminal: Ptyxis (GTK4/GNOME) — https://gitlab.gnome.org/chergert/ptyxis
Shell: zsh
OS: Linux

Plugins

No response

OpenCode version

1.18.5

Steps to reproduce

  1. Open a terminal
  2. Run opencode
  3. Exit using /exit
  4. Observe raw escape sequences printed in the terminal
    Expected behavior: Terminal state is fully restored after exit.
    Actual behavior: Raw SGR mouse tracking sequences are printed:
    ^[[<35;49;13M%
    ^[[<35;91;9M%
    These are mouse press events in SGR extended mouse mode (^[[<button;column;row M), indicating mouse tracking was enabled but not properly disabled on exit.
    Workaround: Running printf '\e[?1000l\e[?1003l\e[?1006l' after exit restores normal terminal behavior.

Screenshot and/or share link

https://opncd.ai/share/h5qhCFLz

Operating System

Ubuntu 26.04 LTS

Terminal

Terminal: Ptyxis (GTK4/GNOME) — https://gitlab.gnome.org/chergert/ptyxis

Activity

  1. github-actions commented on Jul 25, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. kraso commented on Jul 27, 2026

    @kraso
    Author

    I've reviewed those threads and they do seem to be similar situations, but they involve different technologies. What am I supposed to do then, close the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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