Skip to content

Ctrl-C Bug Report #11826

@WingSky2022

Description

@WingSky2022

Description

OpenCodeCLI Bug Report

🐛 Bug Description

When using the Ctrl+C keyboard shortcut in the terminal, neither the copy operation works nor does the program exit normally. Instead, a large amount of garbled text is output to the terminal. This garbled text continues to increase as the mouse wheel is scrolled, severely affecting the terminal user experience.

🎯 Expected Behavior

When Ctrl+C is pressed, the program should be able to:

  • Copy operation: Execute copy when text is selected
  • Interrupt operation: Press the shortcut twice to exit CLI state
  • Clear output: Maintain clear and readable terminal output

❌ Actual Behavior

  • Ctrl+C does not trigger the copy function
  • The program cannot exit normally
  • Large amount of garbled characters appears in the terminal (see screenshot below)
  • Garbled text continues to increase with mouse wheel scrolling

🖥️ Environment Information

  • Operating System: Windows 11 (version not specified)
  • OpenCodeCLI Version: v1.1.48 (latest version)
  • Terminal Type: PowerShell
  • PowerShell Version: [To be supplemented, can be viewed via $PSVersionTable.PSVersion]

🔍 Preliminary Analysis

This issue may be related to the following factors:

  1. Signal Handling Issue: OpenCodeCLI may not properly handle the SIGINT signal on Windows
  2. Terminal Control Sequences: The program may be outputting ANSI escape sequences that are not correctly parsed
  3. Encoding Issue: Mismatch between terminal character encoding and program output encoding
  4. PowerShell Compatibility: The program may not have been adequately tested in PowerShell environment

📝 Additional Information

Impact Scope:

  • This issue still exists in the latest version (1.1.48)
  • Affects basic terminal interaction operations (copy, interrupt)
  • Reduces tool usability and user experience

Testing Suggestions:

  • Suggest testing in other terminal environments (CMD, Windows Terminal, Git Bash) to see if it reproduces
  • Suggest testing on different operating systems (macOS, Linux) to determine if it's a Windows-specific issue

🚀 GitHub Issue Submission Suggestion

When submitting to GitHub, suggested title:

[Bug] Ctrl+C triggers garbled text and cannot properly interrupt program on Windows 11 PowerShell

Tag suggestions: bug, windows, terminal, priority: high


Document created: 2026-02-03
OpenCodeCLI Version: 1.1.48

Plugins

oh-my-opencode

OpenCode version

OpenCodeCLI Version: v1.1.48

Steps to reproduce

💡 Steps to Reproduce

  1. Open PowerShell terminal on Windows 11 system
  2. Launch OpenCodeCLI (version 1.1.48)
  3. Press the Ctrl+C keyboard shortcut while the program is running
  4. Observe garbled text output in the terminal

Screenshot and/or share link

📸 Related Screenshot

Image

Operating System

Windows 11

Terminal

PowerShell

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions