Bug [Visual]: TUI populated with gibberish upon copying #1497

Closed
opened 2026-02-16 17:31:15 -05:00 by yindo · 10 comments
Owner

Originally created by @fkukuck on GitHub (Aug 26, 2025).

Originally assigned to: @kommander on GitHub.

  • GNOME Terminal v3.28.3-4.el8
  • Shell GNU bash v4.4.20(1)-release
  • opencode v0.5.24

Upon release of the mouse button after highlighting text to copy, the TUI is populated with gibberish.
Gibberish can be erased by resizing the terminal window.
Writing into the input does not remove the gibberish completely but only overwrites it for the characters that are newly typed out.

https://github.com/user-attachments/assets/7daf35d0-537c-4d1d-961d-ae3e577fe8ea

This is minor but wanted to make sure it's documented.
Would like to take this opportunity to thank you guys so much for opencode!

Originally created by @fkukuck on GitHub (Aug 26, 2025). Originally assigned to: @kommander on GitHub. - GNOME Terminal v3.28.3-4.el8 - Shell GNU bash v4.4.20(1)-release - opencode v0.5.24 Upon release of the mouse button after highlighting text to copy, the TUI is populated with gibberish. Gibberish can be erased by resizing the terminal window. Writing into the input does not remove the gibberish completely but only overwrites it for the characters that are newly typed out. https://github.com/user-attachments/assets/7daf35d0-537c-4d1d-961d-ae3e577fe8ea This is minor but wanted to make sure it's documented. Would like to take this opportunity to thank you guys so much for opencode!
yindo added the opentuibug labels 2026-02-16 17:31:15 -05:00
yindo closed this issue 2026-02-16 17:31:15 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 26, 2025):

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

  • #2163: Text appears garbled in input box (closed but similar visual corruption)
  • #2192: TUI display alignment and overlay issues in terminals
  • #2207: Plugin output causes ghost/shadow characters that won't go away
  • #2125: Scrolling causes weird text to appear in cursor input

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

@github-actions[bot] commented on GitHub (Aug 26, 2025): This issue might be a duplicate of existing issues. Please check: - #2163: Text appears garbled in input box (closed but similar visual corruption) - #2192: TUI display alignment and overlay issues in terminals - #2207: Plugin output causes ghost/shadow characters that won't go away - #2125: Scrolling causes weird text to appear in cursor input Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Aug 26, 2025):

that’s so strange, tui is about to get a big overhaul so I hope this will be fixed for you when that gets done

@rekram1-node commented on GitHub (Aug 26, 2025): that’s so strange, tui is about to get a big overhaul so I hope this will be fixed for you when that gets done
Author
Owner

@jensenojs commented on GitHub (Sep 2, 2025):

1 :
Image

2 : select first one

Image

3 : Press comma

Image

using item2 on mac, Monaco Nerd Font. I'm not sure if this type of problem is ultimately tracked under this issue?

@jensenojs commented on GitHub (Sep 2, 2025): 1 : <img width="838" height="512" alt="Image" src="https://github.com/user-attachments/assets/9b891673-43b2-4361-ad05-924c7fd4a85e" /> 2 : select first one <img width="674" height="455" alt="Image" src="https://github.com/user-attachments/assets/a389d44c-3636-42cd-8933-67bfb7be92b1" /> 3 : Press comma <img width="690" height="475" alt="Image" src="https://github.com/user-attachments/assets/60baf0f7-7335-436f-9cb6-0585fc3cf5e5" /> using item2 on mac, Monaco Nerd Font. I'm not sure if this type of problem is ultimately tracked under this issue?
Author
Owner

@rekram1-node commented on GitHub (Sep 2, 2025):

There is a separate issue that tracks issues w/ Chinese specifically

@rekram1-node commented on GitHub (Sep 2, 2025): There is a [separate issue](https://github.com/sst/opencode/issues/198) that tracks issues w/ Chinese specifically
Author
Owner

@jensenojs commented on GitHub (Sep 2, 2025):

tks

There is a separate issue that tracks issues w/ Chinese specifically

@jensenojs commented on GitHub (Sep 2, 2025): tks > There is a [separate issue](https://github.com/sst/opencode/issues/198) that tracks issues w/ Chinese specifically
Author
Owner

@jensenojs commented on GitHub (Sep 4, 2025):

Image

updated : original terminal in mac wii seems ok, So it may be related to some settings of item2. @rekram1-node

Is there any other information I can provide that might help diagnose this problem?

updated : "Gibberish can be erased by resizing the terminal window.", same here

Image

1 : Image

2 : select first one

Image 3 : Press comma Image using item2 on mac, Monaco Nerd Font. I'm not sure if this type of problem is ultimately tracked under this issue?
@jensenojs commented on GitHub (Sep 4, 2025): <img width="872" height="547" alt="Image" src="https://github.com/user-attachments/assets/8795474a-16fe-4c86-b63f-d31a71f68a59" /> updated : original terminal in mac wii seems ok, So it may be related to some settings of item2. @rekram1-node Is there any other information I can provide that might help diagnose this problem? updated : "Gibberish can be erased by resizing the terminal window.", same here <img width="1736" height="874" alt="Image" src="https://github.com/user-attachments/assets/c282bf86-c9d2-4061-8705-3e591a73b08d" /> ---- > 1 : <img alt="Image" width="838" height="512" src="https://private-user-images.githubusercontent.com/56761542/484388134-9b891673-43b2-4361-ad05-924c7fd4a85e.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTY5NjU2ODksIm5iZiI6MTc1Njk2NTM4OSwicGF0aCI6Ii81Njc2MTU0Mi80ODQzODgxMzQtOWI4OTE2NzMtNDNiMi00MzYxLWFkMDUtOTI0YzdmZDRhODVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwOTA0VDA1NTYyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkzZDE1N2MwYmY1YThkNjE3M2M3YTg3MzgwMzlmZGUxNDBkMDRiOGExY2JkMTZlZWUxMzEwMDlmZTIxYTBiM2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.K5LFayfIWN4vfxanlL_wXGbUNz2l5DmZhYTGYC1qctg"> > > 2 : select first one > > <img alt="Image" width="674" height="455" src="https://private-user-images.githubusercontent.com/56761542/484388271-a389d44c-3636-42cd-8933-67bfb7be92b1.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTY5NjU2ODksIm5iZiI6MTc1Njk2NTM4OSwicGF0aCI6Ii81Njc2MTU0Mi80ODQzODgyNzEtYTM4OWQ0NGMtMzYzNi00MmNkLTg5MzMtNjdiZmI3YmU5MmIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwOTA0VDA1NTYyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZjNmYyODk5MTAxZDZhMjIyYjcxZDIxMGViMDhhNGFmM2Q1ZTFjYWExMGU4YjkyZjg0YWIwOGYwOGRhYTg5YzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SYqqDiwHnG1sy82Z_6znAIucV2fg7nA9dF3whMMd_6w"> > 3 : Press comma > > <img alt="Image" width="690" height="475" src="https://private-user-images.githubusercontent.com/56761542/484388327-60baf0f7-7335-436f-9cb6-0585fc3cf5e5.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTY5NjU2ODksIm5iZiI6MTc1Njk2NTM4OSwicGF0aCI6Ii81Njc2MTU0Mi80ODQzODgzMjctNjBiYWYwZjctNzMzNS00MzZmLTljYjYtMDU4NWZjM2NmNWU1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwOTA0VDA1NTYyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUwNGY5ZDg5MDBhOTljYWVkODMwMjdiM2UzMzE0MTVlMzExYTZkNzZiOTZlYjRiYWM3ZDJjODE4ZDRmZjUyYmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7QPENucdUCfMOg9_SJZtgWblxyUw6GjrtXVdc8moBlI"> > using item2 on mac, Monaco Nerd Font. I'm not sure if this type of problem is ultimately tracked under this issue?
Author
Owner

@rekram1-node commented on GitHub (Sep 4, 2025):

I wish I could help better here but I am not really sure I think all the different terminals just have some ansi inconsistencies, there maybe something specific to your config causiing issue but like I said this is all going to be moved to opentui soon and I think one of the problems they at least mentioned attacking is inconsistent ansi between terminals

@rekram1-node commented on GitHub (Sep 4, 2025): I wish I could help better here but I am not really sure I think all the different terminals just have some ansi inconsistencies, there maybe something specific to your config causiing issue but like I said this is all going to be moved to opentui soon and I think one of the problems they at least mentioned attacking is inconsistent ansi between terminals
Author
Owner

@jensenojs commented on GitHub (Sep 15, 2025):

I'm not sure if this clue is useful, just note it here for now. I will look into this issue again over the weekend.

I tried the following terminal emulators, and all of them can reproduce the issue I mentioned above:
kitty, item2, wezterm, ghostty, rio

However, some other terminals, such as wave, warp, tabby, do not exhibit the aforementioned problem.

The reason I discovered this difference was because I wanted to try using opencode normally on other terminals. Unfortunately, on the corresponding terminals (wave, warp, tabby), I couldn't use some of the keybindings I originally set up in nvim (such as ). (I believe opencode.nvim is a very good way to integrate AI into nvim.) Then I did some research and eventually found Comprehensive keyboard handling in terminals, Comprehensive keyboard handling in terminals. I tried 4 out of the 7 terminals mentioned and was able to reproduce this issue.

in ghostty, it call tell different between and by using cat -v

Image

But I'm not sure if this issue is related to Chinese characters, it doesn't seem like it, but if OpenTUI is going to be an alternative in the future, we might need to pay attention to this aspect. OpenCode itself might not necessarily need such extensive shortcut recognition support (or maybe it could? You can never have too many shortcuts hahaha).

@jensenojs commented on GitHub (Sep 15, 2025): I'm not sure if this clue is useful, just note it here for now. I will look into this issue again over the weekend. I tried the following terminal emulators, and all of them can reproduce the issue I mentioned above: kitty, item2, wezterm, ghostty, rio However, some other terminals, such as wave, warp, tabby, do not exhibit the aforementioned problem. The reason I discovered this difference was because I wanted to try using opencode normally on other terminals. Unfortunately, on the corresponding terminals (wave, warp, tabby), I couldn't use some of the keybindings I originally set up in nvim (such as <ctrl-shift-p>). (I believe opencode.nvim is a very good way to integrate AI into nvim.) Then I did some research and eventually found [Comprehensive keyboard handling in terminals](https://sw.kovidgoyal.net/kitty/keyboard-protocol/ ), Comprehensive keyboard handling in terminals. I tried 4 out of the 7 terminals mentioned and was able to reproduce this issue. in ghostty, it call tell different between <ctrl-p> and <ctrl-shift-p> by using cat -v <img width="738" height="456" alt="Image" src="https://github.com/user-attachments/assets/4e53e343-1b73-4809-ab76-68adfa9652df" /> But I'm not sure if this issue is related to Chinese characters, it doesn't seem like it, but if OpenTUI is going to be an alternative in the future, we might need to pay attention to this aspect. OpenCode itself might not necessarily need such extensive shortcut recognition support (or maybe it could? You can never have too many shortcuts hahaha).
Author
Owner

@rekram1-node commented on GitHub (Sep 15, 2025):

thanks for this, will keep it in mind

@rekram1-node commented on GitHub (Sep 15, 2025): thanks for this, will keep it in mind
Author
Owner

@fkukuck commented on GitHub (Nov 14, 2025):

FYI original issue still present in opencode 1.0.61

@fkukuck commented on GitHub (Nov 14, 2025): FYI original issue still present in opencode 1.0.61
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1497