Cursor drawn in the wrong place (TMUX + WSL + alacritty #1302

Open
opened 2026-02-16 17:30:21 -05:00 by yindo · 9 comments
Owner

Originally created by @xhuw on GitHub (Aug 14, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Image

git bisect showed be that this commit is the culprit: https://github.com/sst/opencode/commit/b2f2c9ac37e05455c282bf4106a5288d3a1478b3

Originally created by @xhuw on GitHub (Aug 14, 2025). Originally assigned to: @adamdotdevin on GitHub. <img width="894" height="445" alt="Image" src="https://github.com/user-attachments/assets/4dd72c2f-4484-464a-8012-3af3ce6b3609" /> git bisect showed be that this commit is the culprit: https://github.com/sst/opencode/commit/b2f2c9ac37e05455c282bf4106a5288d3a1478b3
Author
Owner

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

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

  • #1905: Terminal cursor blinks in opencode even though it shouldn't - This issue also references the same commit (b2f2c9ac37) that changed cursor handling from virtual to real cursor
  • #1917: In tmux sessions some of the styling is lost - Reports display/rendering issues specifically in tmux sessions
  • #1870: opencode stopped working within tmux - Another tmux-related issue in WSL environment, though this was about complete failure rather than cursor positioning

If none of these address your specific case, please let us know how this issue differs.

@github-actions[bot] commented on GitHub (Aug 14, 2025): 👋 This issue might be a duplicate of existing issues. Please check: - #1905: Terminal cursor blinks in opencode even though it shouldn't - This issue also references the same commit (b2f2c9ac37e05455c282bf4106a5288d3a1478b3) that changed cursor handling from virtual to real cursor - #1917: In tmux sessions some of the styling is lost - Reports display/rendering issues specifically in tmux sessions - #1870: opencode stopped working within tmux - Another tmux-related issue in WSL environment, though this was about complete failure rather than cursor positioning If none of these address your specific case, please let us know how this issue differs.
Author
Owner

@xhuw commented on GitHub (Aug 14, 2025):

This is a new issue. It seems to be related to window size. Tried in windows terminal (no tmux) same issue

https://github.com/user-attachments/assets/a6ccf88d-1468-4a7f-94fd-583cddbd698a

@xhuw commented on GitHub (Aug 14, 2025): This is a new issue. It seems to be related to window size. Tried in windows terminal (no tmux) same issue https://github.com/user-attachments/assets/a6ccf88d-1468-4a7f-94fd-583cddbd698a
Author
Owner

@MilesNorton commented on GitHub (Aug 14, 2025):

Image

I'm also noticing weird cursor placements. I'm using alacrity + tmux but and I'm on linux.

In my case the cursor sits 1 character back and sometimes it goes 2 places back and just looks like I'm editing an existing character. Note: this only happens sometimes - I haven't figured how I get in this state.

For reference in that image, If i were to type 'b' that would appear after the 't'

@MilesNorton commented on GitHub (Aug 14, 2025): <img width="237" height="45" alt="Image" src="https://github.com/user-attachments/assets/072a5184-4575-42fd-b38c-392c56d157fd" /> I'm also noticing weird cursor placements. I'm using alacrity + tmux but and I'm on linux. In my case the cursor sits 1 character back and sometimes it goes 2 places back and just looks like I'm editing an existing character. Note: this only happens sometimes - I haven't figured how I get in this state. For reference in that image, If i were to type 'b' that would appear after the 't'
Author
Owner

@markjaquith commented on GitHub (Aug 19, 2025):

One thing that will cause the cursor position to be incorrect for me is if I do an @-file completion is really long and can't be displayed on one line. It'll start on a new line, then wrap around, and then my text input will be one character different (my cursor is one character behind where characters are appended).

i.e. make it do this:

Image
@markjaquith commented on GitHub (Aug 19, 2025): One thing that will cause the cursor position to be incorrect for me is if I do an @-file completion is really long and can't be displayed on one line. It'll start on a new line, then wrap around, and then my text input will be one character different (my cursor is one character behind where characters are appended). i.e. make it do this: <img width="713" height="230" alt="Image" src="https://github.com/user-attachments/assets/bd370a32-e22c-497f-beb1-80b02de7592d" />
Author
Owner

@mmirus commented on GitHub (Aug 21, 2025):

Ditto on the wrapping @-file completion causing the cursor to be off by one character. Ghostty on Linux; no multiplexer.

@mmirus commented on GitHub (Aug 21, 2025): Ditto on the wrapping @-file completion causing the cursor to be off by one character. Ghostty on Linux; no multiplexer.
Author
Owner

@bgaillard commented on GitHub (Sep 14, 2025):

Hi, I also confirm the behavior described by @xhuw regarding vertical window sizing.

I'm on Linux and have observed this issue in both XFCE4 Terminal and Alacritty with Zellij. Here are two animated GIFs demonstrating the problem.

XFCE 4 Terminal

Image

Alacritty + Zellij

Image

As we can see, the issue is not too critical since it only appears on windows with a very reduced vertical size. However, this happens not so rarely when using a multiplexer and frequently performing splits. Hopefully, this information will help resolve the problem. Thank you for your work on opencode, which is truly very useful!

@bgaillard commented on GitHub (Sep 14, 2025): Hi, I also confirm the behavior described by @xhuw regarding vertical window sizing. I'm on Linux and have observed this issue in both XFCE4 Terminal and Alacritty with Zellij. Here are two animated GIFs demonstrating the problem. **XFCE 4 Terminal** ![Image](https://github.com/user-attachments/assets/b3a5d30b-598e-4a35-8e39-fb5cd012b5b4) **Alacritty + Zellij** ![Image](https://github.com/user-attachments/assets/7c3e0da5-287c-4575-9ce5-fa1930008309) As we can see, the issue is not too critical since it only appears on windows with a very reduced vertical size. However, this happens not so rarely when using a multiplexer and frequently performing splits. Hopefully, this information will help resolve the problem. Thank you for your work on opencode, which is truly very useful!
Author
Owner

@quantonganh commented on GitHub (Sep 19, 2025):

In my case the cursor sits 1 character back and sometimes it goes 2 places back and just looks like I'm editing an existing character. Note: this only happens sometimes - I haven't figured how I get in this state.

One thing that will cause the cursor position to be incorrect for me is if I do an @-file completion is really long and can't be displayed on one line. It'll start on a new line, then wrap around, and then my text input will be one character different (my cursor is one character behind where characters are appended).

To reproduce this issue, split your terminal vertically to make the width smaller. Then @ a long file name, so the prompt wraps onto two lines - the cursor will be off by one character:

Image

If you continue splitting until the prompt wraps onto three lines, the cursor will be off by two characters:

Image
@quantonganh commented on GitHub (Sep 19, 2025): > In my case the cursor sits 1 character back and sometimes it goes 2 places back and just looks like I'm editing an existing character. Note: this only happens sometimes - I haven't figured how I get in this state. > One thing that will cause the cursor position to be incorrect for me is if I do an @-file completion is really long and can't be displayed on one line. It'll start on a new line, then wrap around, and then my text input will be one character different (my cursor is one character behind where characters are appended). To reproduce this issue, split your terminal vertically to make the width smaller. Then `@` a long file name, so the prompt wraps onto two lines - the cursor will be off by one character: <img width="1004" height="304" alt="Image" src="https://github.com/user-attachments/assets/4e1665e7-74f7-4fce-97bf-91a423535ac9" /> If you continue splitting until the prompt wraps onto three lines, the cursor will be off by two characters: <img width="606" height="346" alt="Image" src="https://github.com/user-attachments/assets/a92b7546-b65c-4bb6-9c95-8716a7fe7dc2" />
Author
Owner

@mikebdotuk commented on GitHub (Oct 11, 2025):

Also started experiencing this bug in a similar env. (Manjaro, ghostty, i3wm). Might be tangential, and I haven't reproduced yet, but code supernova started failing hard after the bug would kick in. In bussy python files with a lot of nested indentation every modification it was making would have an extra space character at the start of the line.

@mikebdotuk commented on GitHub (Oct 11, 2025): Also started experiencing this bug in a similar env. (Manjaro, ghostty, i3wm). Might be tangential, and I haven't reproduced yet, but code supernova started failing hard after the bug would kick in. In bussy python files with a lot of nested indentation every modification it was making would have an extra space character at the start of the line.
Author
Owner

@rekram1-node commented on GitHub (Oct 11, 2025):

wait that sounds different than this issue, hm were lsp errors being reported back to the llm?

@rekram1-node commented on GitHub (Oct 11, 2025): wait that sounds different than this issue, hm were lsp errors being reported back to the llm?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1302