Skip to content

[Windows] Hard-killed TUI leaves mouse reporting enabled; next launch does not reset terminal state #18901

@janah01

Description

@janah01

Description

When the TUI is force-killed externally on Windows, the terminal can be left with mouse reporting enabled. After that, moving the mouse floods the prompt with raw escape sequences such as ^[[<35;62;19M. Relaunching opencode does not clear it, because the new renderer inherits the terminal's dirty state.

This is different from #6912 and #13301, which are about Ctrl+C cleanup. With taskkill /F, the process gets no chance to run exit handlers.

Possible fix: disable mouse tracking on TUI startup before enabling it again.

Plugins

none

OpenCode version

1.3.0

Steps to reproduce

  1. Launch opencode in Windows Terminal (PowerShell)
  2. Force-kill it with taskkill /F /PID <pid>
  3. Move the mouse in the terminal — raw escape sequences appear
  4. Relaunch opencode
  5. Move the mouse again — raw escape sequences still appear

Operating System

Windows 11

Terminal

Windows Terminal (PowerShell)

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions