fix(fzf): treat exit code 1 as no matches instead of error#2
Merged
dashed merged 1 commit intodashed:masterfrom Aug 8, 2025
Merged
fix(fzf): treat exit code 1 as no matches instead of error#2dashed merged 1 commit intodashed:masterfrom
dashed merged 1 commit intodashed:masterfrom
Conversation
- Extract fzf error handling into reusable _handle_fzf_error() helper
- Distinguish between exit code 1 (no matches) and actual errors
- Return consistent dict structure: {"matches": []} vs {"error": "..."}
- Apply to both multiline and standard filter modes
- Update test to expect empty matches instead of error for no results
Owner
|
Thank you! |
dashed
added a commit
that referenced
this pull request
Aug 8, 2025
Add comprehensive test coverage to verify that fzf exit code 2
(actual errors) is properly reported as an error, while exit code 1
(no matches) returns empty results.
Changes:
- Add test_fzf_actual_error_handling() for standard mode
- Add test_fzf_actual_error_handling_multiline() for multiline mode
- Fix bug in multiline mode where fzf return codes weren't checked
- Add returncode attribute to mock objects in existing tests
The tests ensure proper distinction between:
- Exit code 1: No matches found (returns {"matches": []})
- Exit code 2: Actual error (returns {"error": "..."})
This completes the PR #2 follow-up improvements.
dashed
added a commit
that referenced
this pull request
Aug 8, 2025
Update documentation to reflect changes from the past 4 days: CHANGELOG.md: - Document limit parameter support for search_files and filter_files - Document fzf exit code handling fixes from PR #2 - Document multiline mode error handling bug fix - Document test coverage improvements README.md: - Add "Recent Updates" section highlighting January 2025 improvements - Update File Search Server features with limit and error handling - Add CLI examples demonstrating --limit parameter usage - Emphasize improved error handling distinguishing "no matches" from errors
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
Fixes fzf error handling to properly treat exit code 1 (no matches found) as an empty result instead of an error.
Changes