Skip to content

remote: Fix missing path escaping in SFTP upload - #62239

Merged
smitbarmase merged 2 commits into
zed-industries:mainfrom
twitchyliquid64:main
Aug 11, 2026
Merged

remote: Fix missing path escaping in SFTP upload#62239
smitbarmase merged 2 commits into
zed-industries:mainfrom
twitchyliquid64:main

Conversation

@twitchyliquid64

Copy link
Copy Markdown
Contributor

Objective

Solution

  • 10-line wrapper function that escapes paths as sftp expects. Namely: paths in quotes with \\ and " escaped.

Testing

  • Did you test these changes? If so, how? cargo check
  • Are there any parts that need more testing? Up to you, this is a simple change and I dont think sftp with default install paths ever worked on MacOS
  • How can other people (reviewers) test your changes? Is there anything specific they need to know? Just connect to a remote on OSX and see if the logs had an sftp upload failure in there
  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test?

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fix remote uploads over sftp where the paths contain spaces

@cla-bot

cla-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @twitchyliquid64 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Aug 5, 2026
@twitchyliquid64

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 5, 2026
@cla-bot

cla-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@maxdeviant maxdeviant changed the title remote: Fix missing path escaping in sftp upload remote: Fix missing path escaping in SFTP upload Aug 5, 2026
@smitbarmase smitbarmase added the platform:remote Remote development, SSH and zed-remote-server label Aug 6, 2026
@smitbarmase smitbarmase self-assigned this Aug 10, 2026

@smitbarmase smitbarmase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, I added tests for this. As well I tested local client parser on macOS and Windows, this looks good to merge.

@smitbarmase
smitbarmase added this pull request to the merge queue Aug 11, 2026
Merged via the queue into zed-industries:main with commit daec37b Aug 11, 2026
36 checks passed
playdohface pushed a commit to playdohface/zed that referenced this pull request Aug 29, 2026
# Objective

- Fixes zed-industries#62238
- Properly escapes paths in the sftp PUT line

## Solution

- 10-line wrapper function that escapes paths as sftp expects. Namely:
paths in quotes with `\\` and `"` escaped.

## Testing

- Did you test these changes? If so, how? `cargo check`
- Are there any parts that need more testing? Up to you, this is a
simple change and I dont think sftp with default install paths ever
worked on MacOS
- How can other people (reviewers) test your changes? Is there anything
specific they need to know? Just connect to a remote on OSX and see if
the logs had an sftp upload failure in there
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Fix remote uploads over sftp where the paths contain spaces

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions platform:remote Remote development, SSH and zed-remote-server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

‎SshRemoteConnection::upload_file sftp arm does not escape spaces in the path

3 participants