Make copy selection report failure without selection - #1166
Open
catlover-bot wants to merge 1 commit into
Open
Conversation
catlover-bot
marked this pull request as ready for review
August 18, 2026 10:08
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
Make
CopySelectionandCopySelectionSystemreport whether they actually had a selection to copy, and propagate that status throughReedlineEvent::EditsoUntilFoundcan continue when there is no active selection.This follows the direction discussed in #876 of making edit operations explicit about their success/failure state. This PR intentionally limits that behavior to the two copy-selection commands; broader edit-command status semantics and
ExecuteHostCommandare out of scope.Observable behavior changes only for
UntilFoundchains containingCopySelectionorCopySelectionSystem.Before
ReedlineEvent::Editwas always treated asHandled, even whenCopySelectionorCopySelectionSystemhad no active selection. As a result, anUntilFoundchain stopped at the copy command and never tried a fallback event such asCtrlC.After
CopySelectionandCopySelectionSystemreturn failure when no selection is active.ReedlineEvent::Editconverts that result toEventStatus::Inapplicable, allowingUntilFoundto try the next event. When a selection exists, the copy command remains handled and the chain stops as before.Regression tests cover both copy commands with and without an active selection.
Additional notes
Addresses the
CopySelection/CopySelectionSystemportion of #876.Validation performed locally:
cargo fmt --all -- --checkcargo clippy --locked --all-targets --all-featurescargo test --all --all-features -- --test-threads=1(1528 passed, 1 ignored; doctests: 30 passed)git diff --checkA local
cargo nextest run --all --all-featureshang was observed in deferred-completion tests. The same class of tty cursor-query hang is being addressed separately in #1156, and the affected test passes immediately undercargo test --all-features.