PowerShell / PowerShell/Win32-OpenSSH

SFTP is unable to fetch files with backslashes in their name

Open
#2,013 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-SFTP Issue-Bug Known-workaround
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce
  1. On a (Unix) remote, create a file named foo\bar with: touch 'foo\bar'
  2. From Windows: sftp <user>@<remote>
  3. get 'foo\\bar' 'foo-bar'
Expected behavior
`Fetching /home/<user>/foo\bar to foo-bar`
Actual behavior
`File "/home/<user>/foo//bar" not found`.
Error details

No response

Environment data
Name                           Value
----                           -----
PSVersion                      7.2.7
PSEdition                      Core
GitCommitId                    7.2.7
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

PowerShell 7.2.7

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows PowerShell 7.2.7 command against a Unix remote, using a filename containing a backslash as described. Trace the SFTP path handling and verify that the backslash remains part of the remote filename rather than becoming a separator; done when the fetch succeeds with the reported command.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.