Skip to content

Keep cursor character and paint coordinates consistent - #341

Open
ghosthack wants to merge 1 commit into
JetBrains:masterfrom
ghosthack:upstream-pr/cursor-paint-race
Open

ghosthack wants to merge 1 commit into
JetBrains:masterfrom
ghosthack:upstream-pr/cursor-paint-race

Conversation

@ghosthack

Copy link
Copy Markdown

A cursor move during painting can blank an existing character while the terminal buffer retains the correct text. For example, after typing blah blah, moving the cursor from the blank after the phrase to the first a between cursor sampling and drawing paints the previously sampled blank over that letter.

Pass the sampled cursor coordinates into drawCursor alongside its character and style so the cursor is painted at the cell it was sampled from. Add an offscreen regression that deterministically interleaves a cursor move from another thread and checks that the first a still has glyph pixels.

Validation: the full :ui:test suite passes against upstream master. The regression fails with the previous implementation, including the published jediterm-ui 3.74 artifact, and passes with this fix. No live terminal sessions were used.

@ghosthack
ghosthack force-pushed the upstream-pr/cursor-paint-race branch from 6839eb9 to 98b42bb Compare October 10, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant