Windows Command Prompt Mouse/Scroll Events Misbehave After Exiting "opencode" #8687

Closed
opened 2026-02-16 18:10:35 -05:00 by yindo · 2 comments
Owner

Originally created by @Vishal-080 on GitHub (Feb 6, 2026).

Originally assigned to: @kommander on GitHub.

Description

While using opencode from the Windows Command Prompt (cmd.exe), the terminal starts behaving incorrectly after opencode is closed or exited.

Once the opencode process terminates, the Command Prompt does not properly restore its original input state. As a result, mouse-related interactions become unstable, including:

Mouse scrolling behaves erratically or stops working correctly

Mouse movement triggers unexpected behavior

Cursor positioning becomes inconsistent when interacting with the terminal

This issue persists for the current Command Prompt session and typically requires closing and reopening the terminal to restore normal behavior.

The problem appears to be related to opencode not fully resetting the terminal/console state on exit, particularly around mouse or input handling on Windows.

Plugins

oh-my-opencode

OpenCode version

No response

Steps to reproduce

  1. Open Windows Command Prompt (cmd.exe)

  2. Navigate to any directory (optional)

  3. Run opencode

  4. Use opencode normally for a short time

  5. Exit or close opencode (for example, using its exit command or "ctrl+c" or closing the session)

  6. After returning to the Command Prompt, try the following:

6.1. Scroll using the mouse wheel

6.2. Move the mouse cursor over the terminal

6.3. Click inside the terminal window

Screenshot and/or share link

No response

Operating System

windows-10

Terminal

command prompt (windows)

Originally created by @Vishal-080 on GitHub (Feb 6, 2026). Originally assigned to: @kommander on GitHub. ### Description While using opencode from the Windows Command Prompt (cmd.exe), the **terminal starts behaving incorrectly after opencode is closed or exited.** Once the opencode process terminates, the Command Prompt does not properly restore its original input state. As a result, mouse-related interactions become unstable, including: Mouse scrolling behaves erratically or stops working correctly Mouse movement triggers unexpected behavior Cursor positioning becomes inconsistent when interacting with the terminal This issue persists for the current Command Prompt session and typically requires closing and reopening the terminal to restore normal behavior. The problem appears to be related to **opencode** not fully resetting the terminal/console state on exit, particularly around mouse or input handling on Windows. ### Plugins oh-my-opencode ### OpenCode version _No response_ ### Steps to reproduce 1. Open Windows Command Prompt (cmd.exe) 2. Navigate to any directory (optional) 3. Run opencode 4. Use opencode normally for a short time 5. Exit or close opencode (for example, using its exit command or "ctrl+c" or closing the session) 6. After returning to the Command Prompt, try the following: 6.1. Scroll using the mouse wheel 6.2. Move the mouse cursor over the terminal 6.3. Click inside the terminal window ### Screenshot and/or share link _No response_ ### Operating System windows-10 ### Terminal command prompt (windows)
yindo added the windowsopentuibug labels 2026-02-16 18:10:35 -05:00
yindo closed this issue 2026-02-16 18:10:35 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 6, 2026):

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

  • #7316: Mouse wheel stops working after some usage on Windows Terminal
  • #8908: Mouse wheel triggering abnormal ASCII codes after exiting (Windows 11)
  • #11748: Scrolling mouse wheel and moving mouse in PowerShell causes garbled characters after closing OpenCode
  • #10719: Terminal state not restored when exiting with ctrl+c on Windows (git bash)
  • #6912: Ctrl+C does not disable mouse tracking, causing raw escape sequences to flood terminal (Windows)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 6, 2026): This issue might be a duplicate of existing issues. Please check: - #7316: Mouse wheel stops working after some usage on Windows Terminal - #8908: Mouse wheel triggering abnormal ASCII codes after exiting (Windows 11) - #11748: Scrolling mouse wheel and moving mouse in PowerShell causes garbled characters after closing OpenCode - #10719: Terminal state not restored when exiting with ctrl+c on Windows (git bash) - #6912: Ctrl+C does not disable mouse tracking, causing raw escape sequences to flood terminal (Windows) Feel free to ignore if none of these address your specific case.
Author
Owner

@Hona commented on GitHub (Feb 12, 2026):

this is fixed as of 1.1.60

@Hona commented on GitHub (Feb 12, 2026): this is fixed as of 1.1.60
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8687