Skip to content

Input sometimes starts to only show ASCII escape codes #5181

Closed

Description

@bcardarella

Description

Image

Even mousing over will cause the input to fill

OpenCode version

1.0.34

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

MacOS Tahoe 26.1

Terminal

Ghostty 1.2.3

Activity

  1. github-actions commented on Dec 6, 2025

    @github-actions
    Contributor

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

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

  2. vruss commented on Dec 8, 2025

    @vruss

    Having same issue on Windows both in git bash and powershell using both the new Windows terminal and built in VS Code terminal

    Image
  3. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 8, 2025
  4. kommander commented on Dec 8, 2025

    @kommander
    Collaborator

    You are mentioning version 1.0.34, which had that issue, is that a typo in the version or can you upgrade to the latest version, which is quite ahead?

  5. bcardarella commented on Dec 8, 2025

    @bcardarella
    Author

    It's version 1.0.134

  6. kommander commented on Dec 8, 2025

    @kommander
    Collaborator

    What command are you running to get this?

  7. bcardarella commented on Dec 8, 2025

    @bcardarella
    Author

    It happens when the opencode memory grows crazy high. 10s of GBs. There's no specifc command, if I run for 3 - 4 hours of work it'll happen every time

  8. kommander commented on Dec 8, 2025

    @kommander
    Collaborator

    But that doesn't look like opencode?

    Edit: Sorry I meant what @vruss posted doesn't look like opencode.

  9. kommander commented on Dec 8, 2025

    @kommander
    Collaborator

    @bcardarella So the actual issue is memory pressure and the process getting killed, which doesn't reset the terminal, stdin staying in raw mode with mouse capturing enabled, ending up in the spilled escaped sequence issue.

    Can you run with opencode spawn, which separates the server and TUI in own processes. Then when the high memory usage happens, could you check which of the processes has the high memory usage? On macos you can run ps -axww -o pid,ppid,command | grep opencode which should give you something like this:

    Image

    Where the second process 19989 is the TUI, so you can lookup which process actually has the high memory usage. That would help diagnosing if it is an agent or TUI issue.

  10. bcardarella commented on Dec 8, 2025

    @bcardarella
    Author

    Will do!

  11. vruss commented on Dec 9, 2025

    @vruss

    But that doesn't look like opencode?

    Edit: Sorry I meant what @vruss posted doesn't look like opencode.

    Oh I forgot to mention it happens after I exit opencode with ctrl+c. Then that terminal window is bugged and keep spewing characters as I move my mouse aroudn until I close it.

    Steps to reproduce for me:

    1. Start opencode from terminal
    2. Type any prompt
    3. Kill process with ctrl+c
    4. Now mouse will enter stuff in terminal, if not, then repeat step 1-3
      Image
  12. kommander commented on Dec 9, 2025

    @kommander
    Collaborator

    I just did that like 50 times with PowerShell 7.5.4 on win11 and it exits cleanly with ctrl+c. It definitely looks like windows is shutting down the process before any cleanup can happen. The signal seems to be fine, just SIGINT for ctrl+c. Maybe windows/bun has a limit in which a process needs to be shut down after the signal and if it is too slow it will not get to the cleanup part. I can try moving the the terminal cleanup up front before other shutdown stuff so it happens as the first thing when a signal is received. I'll try that tomorrow and give you a snapshot to test.

  13. vruss commented on Dec 9, 2025

    @vruss

    Ok thank you @kommander ! Just some some more context. I tried this in Alacritty and WezTerm too, with powershell and gitbash as shell and they all have the same behavior.

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

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions