Skip to content

Conversation

@smach
Copy link

@smach smach commented Dec 27, 2025

On Windows, normalizePath() returns backslash paths like D:\path\to\logs. The previous code created invalid URLs like file://D:\path\to\logs.

Claude Opus 4.5 says:
Valid Windows file URLs need:

  • Three slashes before the drive letter: file:///D:/...
  • Forward slashes in the path

Added path_to_file_url() helper that uses winslash="/" and adds the correct number of slashes per platform.

Fixes log viewer showing "no logs" on Windows reported in Issue 199

🤖 Code generated in large part by Claude Code

On Windows, normalizePath() returns backslash paths like D:\path\to\logs.
The previous code created invalid URLs like file://D:\path\to\logs.

Valid Windows file URLs need:
- Three slashes before the drive letter: file:///D:/...
- Forward slashes in the path

Added path_to_file_url() helper that uses winslash="/" and adds the
correct number of slashes per platform.

Fixes log viewer showing "no logs" on Windows.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@smach
Copy link
Author

smach commented Dec 27, 2025

(Although this may end up causing other viewer problems now that I'm testing more myself. But I do think the issue is Windows file formats)

The previous commit fixed URL generation but broke loading logs because
file:///D:/path was being parsed back to /D:/path (invalid on Windows).

Added file_url_to_path() helper that strips the extra leading slash
on Windows when converting file:// URLs back to filesystem paths.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@smach smach marked this pull request as ready for review December 27, 2025 23:50
@smach
Copy link
Author

smach commented Dec 27, 2025

Possible fix?

Copy link
Collaborator

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much! This seems like a reasonable approach.

I'm currently taking a couple weeks to rest but will come back to this in the New Year. :)

@smach
Copy link
Author

smach commented Dec 29, 2025

Rest is awesome! Hope you have a couple of great holiday weeks. Absolutely no rush on this, only reason I brought this up now is because I'm staying home in some miserable winter weather playing with my extra Claude usage 😅 Happy New Year!

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.

2 participants