Preserve wide-character invariants during no-reflow clear resize#12244
Preserve wide-character invariants during no-reflow clear resize#12244ChanlerDev wants to merge 1 commit into
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @ChanlerDev on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
|
Every PR must be linked to a same-repo issue before Oz can review it. This PR is linked to #12243, but no linked issue is marked See the contribution guidelines for the full readiness model. Powered by Oz |
There was a problem hiding this comment.
Every PR must be linked to a same-repo issue before Oz can review it.
This PR is linked to #12243, but no linked issue is marked ready-to-implement yet. Only repository maintainers apply that label, so please wait for a maintainer to mark the issue. Once it is marked, push a new commit or comment /oz-review to re-trigger review.
See the contribution guidelines for the full readiness model.
Powered by Oz
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Description
Fixes a
RowIterator::nextcrash that can occur afterFullGridClearBehavior::Clearresizes the active grid without reflow.In that path,
GridStorage::shrink_cols(reflow=false)can truncate a valid wide-character pair between theWIDE_CHARcell and itsWIDE_CHAR_SPACER, leaving an orphaned final-columnWIDE_CHAR. If that row later enters flat storage, materialization can attempt to write the missing spacer beyond the end of the row and panic.This PR fixes the producer side of the issue: after no-reflow shrink, if the new final cell is
WIDE_CHARand the first discarded cell was its matchingWIDE_CHAR_SPACER, the final cell is no longer marked as double-width. This preserves the row invariant after truncation and preventsFlatStorage::pop_rows/RowIterator::nextfrom materializing an impossible spacer.Scope note: this is intentionally a source-side fix for the confirmed
FullGridClearBehavior::Clear+shrink_cols(reflow=false)producer. It does not claim to be a general hardening layer for every possible malformed flat-storage row.Linked Issue
Fixes #12243
ready-to-implement.Note: this is a non-visual crash fix. The linked issue includes sanitized crash-report and Warp-log excerpts plus the deterministic regression shape. The issue has already received automated triage labels
triagedandrepro:high, but it has not yet receivedready-to-implement; please apply readiness during triage if appropriate.Testing
Automated regression coverage:
./script/presubmitstatus:Observed presubmit failures:
None of the observed failures are in the modified grid storage / row invariant tests. The focused regression tests for this PR pass, but the full presubmit run did not complete green in this local environment.
Regression red/green proof:
The new regression test exercises the relevant producer path:
GridHandler.FullGridClearBehavior::Clear.WIDE_CHAR@116,WIDE_CHAR_SPACER@117.grid.resize(...)API to 117 columns.Manual testing:
./script/runManual testing note:
./script/runbuilt, bundled, signed, and launchedWarpOss.applocally. The original user-visible crash depends on a narrow timing/layout condition involving command enter, clear hook handling, resize, and a wide-character boundary, so the deterministicGridHandlerregression test is the primary proof for the confirmed producer-side corruption path.Screenshots / Videos
This is a non-visual crash fix. A screenshot is not meaningful for the code change itself. If maintainers request manual evidence, I can attach a short local smoke-test recording showing Warp running through resize/clear activity without crashing.
Agent Mode
CHANGELOG-BUG-FIX: Fixed a crash that could occur after resizing CLI-agent terminal output containing wide characters.
Co-Authored-By: Warp agent@warp.dev