Input sometimes starts to only show ASCII escape codes #3365

Open
opened 2026-02-16 17:39:47 -05:00 by yindo · 12 comments
Owner

Originally created by @bcardarella on GitHub (Dec 6, 2025).

Originally assigned to: @kommander on GitHub.

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

Originally created by @bcardarella on GitHub (Dec 6, 2025). Originally assigned to: @kommander on GitHub. ### Description <img width="894" height="699" alt="Image" src="https://github.com/user-attachments/assets/3ac6d3e5-4747-42c6-8822-0408123d28db" /> 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
yindo added the opentuibug labels 2026-02-16 17:39:47 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 6, 2025):

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

  • #457: Scroll down -> get ascii coded into input (same symptom of ASCII codes appearing in input)
  • #2593: [bug] opencode produces gabled text when input containing non-ascii characters (related character encoding issues)
  • #4320: Characters are encoding gibberish all over the frontend (broader character encoding problem)

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

@github-actions[bot] commented on GitHub (Dec 6, 2025): This issue might be a duplicate of existing issues. Please check: - #457: Scroll down -> get ascii coded into input (same symptom of ASCII codes appearing in input) - #2593: [bug] opencode produces gabled text when input containing non-ascii characters (related character encoding issues) - #4320: Characters are encoding gibberish all over the frontend (broader character encoding problem) Feel free to ignore if none of these address your specific case.
Author
Owner

@vruss commented on GitHub (Dec 8, 2025):

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

Image
@vruss commented on GitHub (Dec 8, 2025): Having same issue on Windows both in git bash and powershell using both the new Windows terminal and built in VS Code terminal <img width="1918" height="717" alt="Image" src="https://github.com/user-attachments/assets/fe7f082d-ecef-4d68-b4f2-b25baebc3c6b" />
Author
Owner

@kommander commented on GitHub (Dec 8, 2025):

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?

@kommander commented on GitHub (Dec 8, 2025): 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?
Author
Owner

@bcardarella commented on GitHub (Dec 8, 2025):

It's version 1.0.134

@bcardarella commented on GitHub (Dec 8, 2025): It's version 1.0.134
Author
Owner

@kommander commented on GitHub (Dec 8, 2025):

What command are you running to get this?

@kommander commented on GitHub (Dec 8, 2025): What command are you running to get this?
Author
Owner

@bcardarella commented on GitHub (Dec 8, 2025):

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

@bcardarella commented on GitHub (Dec 8, 2025): 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
Author
Owner

@kommander commented on GitHub (Dec 8, 2025):

But that doesn't look like opencode?

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

@kommander commented on GitHub (Dec 8, 2025): But that doesn't look like opencode? Edit: Sorry I meant what @vruss posted doesn't look like opencode.
Author
Owner

@kommander commented on GitHub (Dec 8, 2025):

@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.

@kommander commented on GitHub (Dec 8, 2025): @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: <img width="400" height="86" alt="Image" src="https://github.com/user-attachments/assets/67c2ee83-2c43-4237-99e1-ef141ffc689f" /> 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.
Author
Owner

@bcardarella commented on GitHub (Dec 8, 2025):

Will do!

@bcardarella commented on GitHub (Dec 8, 2025): Will do!
Author
Owner

@vruss commented on GitHub (Dec 8, 2025):

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
@vruss commented on GitHub (Dec 8, 2025): > But that doesn't look like opencode? > > Edit: Sorry I meant what [@vruss](https://github.com/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](https://github.com/user-attachments/assets/7ff8e0ec-317b-4cb4-9f0c-2fba589600ac)
Author
Owner

@kommander commented on GitHub (Dec 8, 2025):

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.

@kommander commented on GitHub (Dec 8, 2025): 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.
Author
Owner

@vruss commented on GitHub (Dec 9, 2025):

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.

@vruss commented on GitHub (Dec 9, 2025): 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3365