Fix: GUI finds 0 broken symlinks when CLI finds them correctly#1851
Draft
Fix: GUI finds 0 broken symlinks when CLI finds them correctly#1851
Conversation
… relative symlink resolution Co-authored-by: qarmin <41945903+qarmin@users.noreply.github.com> Agent-Logs-Url: https://github.com/qarmin/czkawka/sessions/27405ff3-5207-413d-8b67-5df659114e9a
Co-authored-by: qarmin <41945903+qarmin@users.noreply.github.com> Agent-Logs-Url: https://github.com/qarmin/czkawka/sessions/27405ff3-5207-413d-8b67-5df659114e9a
Copilot
AI
changed the title
[WIP] Fix GUI not detecting broken symlinks found by CLI
Fix: GUI finds 0 broken symlinks when CLI finds them correctly
Mar 24, 2026
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.
The GUI (krokiet) fails to find broken symlinks that the CLI detects correctly, returning 0 results when scanning directories like
/home/user/.config/.Root Causes & Fixes
1.
DEFAULT_EXCLUDED_ITEMScontained an overly broad pattern/home/*/.*was intended to exclude top-level hidden items in home directories, but theregex_checkimplementation allows*to match path separators. This caused it to match any file inside any hidden directory — e.g.,/home/juan/.config/alacrittymatched because/.appears in/.config. New users with default GUI settings scanning inside any~/.config/or similar hidden directory got 0 results.Fix: Removed
/home/*/.*fromDEFAULT_EXCLUDED_ITEMS. The more targeted/home/*/.cache/*and/home/*/.var/app/entries remain.2. Relative symlink targets resolved against process CWD instead of symlink's parent
In
check_invalid_symlinks, when following a symlink chain to detect infinite recursion, relative targets returned byread_link()were passed directly to the nextread_link()call. The OS resolves these relative to the process CWD, not the symlink's parent directory — wrong for any symlink not in the CWD.Fix: Capture
parent_dirbefore eachread_link()and join relative results with it:3. Added regression test
Added
test_find_invalid_symlinks_relative_pathto verify broken symlinks with relative targets (e.g.,../nonexistent/path) are correctly detected.Original prompt
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.