Skip to content

fix(linux): fix file explorer opening wrong directory (#4397) - #4777

Merged
leaanthony merged 2 commits into
v3-alphafrom
fix/fileexplorer-directory-uri
Dec 12, 2025
Merged

leaanthony merged 2 commits into
v3-alphafrom
fix/fileexplorer-directory-uri

Conversation

@leaanthony

Copy link
Copy Markdown
Member

Summary

Fixes the file explorer opening the wrong directory on Linux when using OpenFileManager().

Root Cause

The pathToURI function was using url.PathEscape which incorrectly escapes forward slashes:

/home/angaz -> file://%2Fhome%2Fangaz (broken)

File managers couldn't parse these malformed URIs correctly, causing them to open the wrong directory (often a parent directory like /home instead of /home/angaz).

Fix

Changed to use url.URL struct which properly constructs file URIs:

/home/angaz -> file:///home/angaz (correct)

Spaces and other special characters are still properly escaped (e.g., My Documents → My%20Documents).

Test plan

  • Test OpenFileManager("/home/username", true) opens the correct directory
  • Test paths with spaces work correctly
  • Test with different file managers (Nautilus, Dolphin, Thunar, etc.)

Fixes #4397

🤖 Generated with Claude Code

The pathToURI function was using url.PathEscape which incorrectly
escapes forward slashes (/ -> %2F). This caused file URIs like:

  /home/angaz -> file://%2Fhome%2Fangaz (broken)

File managers couldn't parse these malformed URIs correctly, causing
them to open the wrong directory (often a parent directory).

Fixed by using url.URL struct to properly construct file URIs:

  /home/angaz -> file:///home/angaz (correct)

Spaces and other special characters are still properly escaped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 12, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@leaanthony has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e0cd242 and 085e4f4.

📒 Files selected for processing (2)
  • v3/UNRELEASED_CHANGELOG.md (1 hunks)
  • v3/internal/fileexplorer/fileexplorer_linux.go (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/fileexplorer-directory-uri

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: 085e4f4
Status:⚡️  Build in progress...

View logs

@leaanthony
leaanthony merged commit acae209 into v3-alpha Dec 12, 2025
14 of 16 checks passed
@leaanthony
leaanthony deleted the fix/fileexplorer-directory-uri branch December 12, 2025 23:35
@sonarqubecloud

Copy link
Copy Markdown

Grantmartin2002 pushed a commit to Grantmartin2002/wails that referenced this pull request Apr 29, 2026
…wailsapp#4777)

The pathToURI function was using url.PathEscape which incorrectly
escapes forward slashes (/ -> %2F). This caused file URIs like:

  /home/angaz -> file://%2Fhome%2Fangaz (broken)

File managers couldn't parse these malformed URIs correctly, causing
them to open the wrong directory (often a parent directory).

Fixed by using url.URL struct to properly construct file URIs:

  /home/angaz -> file:///home/angaz (correct)

Spaces and other special characters are still properly escaped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant