fix: resolve POSIX path handling and test failures on Windows#3792
Open
Piyush0049 wants to merge 5 commits into
Open
fix: resolve POSIX path handling and test failures on Windows#3792Piyush0049 wants to merge 5 commits into
Piyush0049 wants to merge 5 commits into
Conversation
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🔴 CRITICAL
This PR introduces two bugs in its path-handling fixes:
-
postedit.go — Path-scoped glob patterns (containing ) will never match because the code compares a relative pattern against an absolute . Post-edit commands configured with patterns like will silently never execute.
-
workingdir.go — Removing from the function removes a safety net that guaranteed an absolute path result when is relative.
Piyush0049
force-pushed
the
fix/windows-compatibility-fixes
branch
from
July 23, 2026 06:40
cc80abb to
9e1b3df
Compare
Contributor
Author
|
Actually two of my commits were not verified. I fixed them. Please do let me know if any other changes are required. |
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
This pull request resolves several path resolution bugs and unit test failures on Windows environments.
Proposed Changes
1.
pkg/tools/builtin/filesystem/postedit.gorunPostEditCommandsto match path-scoped glob patterns (e.g.pkg/*.go) against full relative paths instead of stripping directory names withfilepath.Base().2.
pkg/session/session.goAddAttachedFileto recognize POSIX absolute paths starting with/on Windows. This prevents file attachments from being dropped and fixes out-of-bounds slice panics in tests.3.
pkg/tools/workingdir/workingdir.go&workingdir_test.goworkingdir.Resolve()to treat leading/as absolute paths across OS boundaries. This prevents paths like/tmp/appfrom being joined to local host working directories on Windows.filepath.Join().4.
pkg/tools/builtin/sessionplan/sessionplan_test.goTestPathassertions to usefilepath.Join()for platform path separator compatibility.5.
pkg/tui/internal/editorname/editorname_test.goTestFromEnvto dynamically match platform default editor names (Notepadon Windows,Vielsewhere).6.
pkg/session/sqlitestore/sqlitestore_test.goTestNew_DirectoryNotWritablebecause POSIX permission bits (0o555) do not prevent directory writes on Windows NTFS.Verification
All affected test suites have been verified and pass cleanly:
go test ./pkg/session/...go test ./pkg/session/sqlitestorego test ./pkg/tools/workingdirgo test ./pkg/tools/builtin/sessionplango test ./pkg/tui/internal/editorname