fix(sftp): resolve relative paths to session HOME - #1177
Merged
Conversation
📝 WalkthroughWalkthroughSFTP relative paths now resolve from the session home directory. Workspace files use explicit ChangesSFTP path resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
evanspearman
approved these changes
Aug 5, 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.
exec channels start in the session's home ($HOME=/home, so
cd; mkdir -p .zed_servercreates/home/.zed_server), while the SFTP subsystem resolves relative paths against the session's working tree (/workbench).The spec and expected-behavior specifies that these should resolve to
$HOME, so fixing this in the sftp server implementation.Summary by CodeRabbit
Note
Resolve relative SFTP paths against session HOME instead of workspace root
SftpSession.resolvein sftp.rs to useenv::HOME_ROOTas the base for relative paths, sorealpath('.')now reports the home directory rather than the working tree./workbench/…paths for SFTP reads, since relative paths no longer resolve to the workspace.hello.txt) to address files in the workspace will no longer find them there; paths must now be fully qualified as/workbench/hello.txt.Macroscope summarized b893fb1.