Skip to content

terminal: avoid VS15 cursor underflow - #13631

Merged
mitchellh merged 1 commit into
mainfrom
vs-underflow
Aug 5, 2026
Merged

mitchellh merged 1 commit into
mainfrom
vs-underflow

Conversation

@mitchellh

Copy link
Copy Markdown
Contributor

Handle VS15 width changes when the wide grapheme base is directly under the cursor.

A zero cursor distance previously underflowed while locating the spacer tail. Debug builds panicked and ReleaseFast computed an out-of-bounds cell pointer before updating it.

Handle VS15 width changes when the wide grapheme base is directly under
the cursor. Cover both disabled wraparound and restored pending-wrap
cursor states.

A zero cursor distance previously underflowed while locating the spacer
tail. Debug builds panicked and ReleaseFast computed an out-of-bounds
cell pointer before updating it.

Find the spacer from the wide base instead of subtracting from the
cursor distance. Reposition the cursor from the base column and clamp it
to the active right margin.
@mitchellh
mitchellh requested a review from a team as a code owner August 5, 2026 15:55
@ghostty-bot ghostty-bot Bot added the vt Control sequence related label Aug 5, 2026
@mitchellh mitchellh added this to the 1.4.0 milestone Aug 5, 2026
@mitchellh
mitchellh merged commit bd21ff1 into main Aug 5, 2026
191 checks passed
@mitchellh
mitchellh deleted the vs-underflow branch August 5, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vt Control sequence related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant