Fix cmd-click crash when command-mark data is unavailable#695
Closed
onemedicine wants to merge 2 commits into
Closed
Fix cmd-click crash when command-mark data is unavailable#695onemedicine wants to merge 2 commits into
onemedicine wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens command-mark lookup in VT100ScreenState so Cmd-click URL/prompt resolution can gracefully fall back when command-mark data is missing or inconsistent, avoiding a crash in the terminal interaction flow.
Changes:
- Add bounds/validity guards in
VT100ScreenState -commandMarkAt:mustHaveCommand:range:for out-of-range coordinates, missing marks, and missing interval-tree entries. - Add targeted
VT100ScreenTestscoverage for out-of-bounds and no-mark cases. - Document the crash fix in the 3.7 release notes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sources/VT100Screen/VT100ScreenState.m | Adds defensive checks so command-mark lookup returns nil instead of crashing when mark data is unavailable/invalid. |
| ModernTests/VT100ScreenTests.swift | Adds regression tests covering out-of-bounds and no-mark command-mark lookups. |
| docs/notes-3.7.txt | Notes the Cmd-click crash fix in the 3.7 bug fixes section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Owner
|
Thank you! This is a clean, well-guarded fix, and I appreciate the thorough regression tests covering the out-of-bounds, no-mark, and mark-without-command paths (and for addressing the review note about mustHaveCommand). All three tests pass here. Merged (squashed) as f036dee, with you as the author. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VT100ScreenStatecommand-mark lookup against out-of-bounds coordinates, missing marks, and missing interval-tree entriesVT100ScreenTestscoverage for the out-of-bounds and no-mark cases, and document the fix in the 3.7 release notesTest plan
make paranoid-depstools/run_tests.expect ModernTests/VT100ScreenTests/testCommandMarkAtReturnsNilWhenLineIsOutOfBounds ModernTests/VT100ScreenTests/testCommandMarkAtReturnsNilWhenNoMarkOnLineNotes
masterso the PR is a single fix commit on top of upstream.