Skip to content

terminal: handle page capacity errors in cursorScrollAbove - #13394

Merged
mitchellh merged 1 commit into
mainfrom
push-qzvvllztuuvt
Jul 20, 2026
Merged

mitchellh merged 1 commit into
mainfrom
push-qzvvllztuuvt

Conversation

@mitchellh

Copy link
Copy Markdown
Contributor

Re: #13160

When cursorScrollAbove rotates rows across a page boundary, the last row of the previous page is cloned into the destination page. That can cause capacity failures we didn't previously handle.

The error propagated out of the operation after rows had already been rotated, leaving the page list half-mutated. Subsequent operations on the corrupted state can cause crashes since the state was incoherent.

Handle these errors the same way insertLines and deleteLines already do for their cross-page copies: increase the destination page capacity for the dimension that ran out and retry the row copy.

Re: #13160

When cursorScrollAbove rotates rows across a page boundary, the last
row of the previous page is cloned into the destination page. That can
cause capacity failures we didn't previously handle.

The error propagated out of the operation after rows had already been rotated, 
leaving the page list half-mutated. Subsequent operations on the corrupted state
can cause crashes since the state was incoherent.

Handle these errors the same way insertLines and deleteLines already
do for their cross-page copies: increase the destination page capacity
for the dimension that ran out and retry the row copy.
@mitchellh
mitchellh requested a review from a team as a code owner July 20, 2026 15:04
@ghostty-bot ghostty-bot Bot added the vt Control sequence related label Jul 20, 2026
@mitchellh mitchellh added this to the 1.4.0 milestone Jul 20, 2026
@mitchellh

Copy link
Copy Markdown
Contributor Author

FYI I think eraseRow family has the same bug, but will post that in isolation if true. I'm looking around for other places we don't handle capacities properly.

@mitchellh
mitchellh merged commit 56b086b into main Jul 20, 2026
181 of 183 checks passed
@mitchellh
mitchellh deleted the push-qzvvllztuuvt branch July 20, 2026 15:16
neurosnap added a commit to neurosnap/zmx that referenced this pull request Jul 21, 2026
This updates libghostty which fixes a SIGABRT from hyperlink rendering.

Closes: #182
Reference: ghostty-org/ghostty#13394
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libghostty vt Control sequence related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant