Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging and dropping a file into a WSL terminal will use the incorrect '\' separator #78751

Closed
alphagocc opened this issue Aug 9, 2019 · 10 comments · Fixed by #170216
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. verified Verification succeeded windows VS Code on Windows issues WSL Issue when using WSL
Milestone

Comments

@alphagocc
Copy link

alphagocc commented Aug 9, 2019

  • VSCode Version: 1.37.0
  • OS Version: 10.0.18632

Steps to Reproduce:

Drag a file to the WSL Shell

File path separator is '\' not '/'

image

Does this issue occur when all extensions are disabled?: Yes
(But in fact I have to enable Remote WSL extensions

@vscodebot vscodebot bot added the new release label Aug 9, 2019
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label windows VS Code on Windows issues WSL Issue when using WSL labels Aug 9, 2019
@Tyriar Tyriar added this to the August 2019 milestone Aug 9, 2019
@Tyriar
Copy link
Member

Tyriar commented Aug 9, 2019

Note to self: For files dragged in via OS they should be resolved in window, dragged in via file explorer should be resolved in ext host. One complication here is for WSL where we need to run wslpath for files dragged from explorer, this might need better WSL terminal detection and marking terminal instances with additional information.

@vscodebot vscodebot bot removed the new release label Aug 13, 2019
@Tyriar Tyriar modified the milestones: August 2019, September 2019 Aug 23, 2019
@Tyriar Tyriar modified the milestones: September 2019, October 2019 Sep 30, 2019
@Tyriar Tyriar changed the title WSL separator is '\' not '/' Dragging and dropping a file into a WSL terminal will use the incorrect '\' separator Oct 9, 2019
@eamodio eamodio added the verification-needed Verification of issue is requested label Oct 28, 2019
@eamodio
Copy link
Contributor

eamodio commented Oct 28, 2019

For verification:

Setup: Windows 10

  1. Open a PowerShell terminal
  2. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes \
  3. Open a PowerShell Core terminal
  4. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes \
  5. Open a Command Prompt terminal
  6. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes \
  7. Open a Git Bash terminal
  8. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes /
  9. Open a WSL terminal
  10. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes /, and that the path is translated into a WSL path (e.g. /mnt/*)

  1. Open a PowerShell or Command Prompt terminal
  2. Run powershell.exe
  3. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes \
  4. Run pwsh.exe (PowerShell Core)
  5. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes \
  6. Run cmd.exe
  7. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes \
  8. Run bash.exe (from Git)
  9. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes /
  10. Run wsl.exe
  11. Ensure that when dragging a file from the desktop or from the vscode explorer the path has the correct slashes /, and that the path is translated into a WSL path (e.g. /mnt/*)

@alexr00 alexr00 reopened this Oct 30, 2019
@alexr00 alexr00 added the verification-found Issue verification failed label Oct 30, 2019
@alexr00
Copy link
Member

alexr00 commented Oct 30, 2019

Dragging any file into a wsl integrated terminal doesn't produce a path for me.

@alexr00
Copy link
Member

alexr00 commented Oct 30, 2019

When I start with a powershell integrated terminal, then run git bash.exe, dragging a file from the desktop into the terminal produces the wrong slashes. From VS Code file explorer it's ok. When the integrated terminal starts as git bash it's also ok.

@alexr00
Copy link
Member

alexr00 commented Oct 30, 2019

Finally, when I start with a powershell integrated terminal, then run wsl.exe, dragging a file from the VS Code explorer doesn't produce a path. Dragging a file from the desktop produce a Windows path.

@eamodio
Copy link
Contributor

eamodio commented Oct 31, 2019

@alexr00 are you on WSL1? Also what version of Windows?

@alexr00
Copy link
Member

alexr00 commented Oct 31, 2019

Yes, I"m on WSL 1. Windows version 1901, build 18363.418. Default distro is Alpine.

@kieferrm kieferrm modified the milestones: October 2019, November 2019 Oct 31, 2019
@Tyriar Tyriar modified the milestones: November 2019, Backlog Nov 26, 2019
@CM000n
Copy link

CM000n commented Jun 17, 2021

I also have this behavior. When I drag and drop a file from a WSL filelist into the WSL bash, VS code creates a path specification that uses \ instead of /.

It cannot find the folder/file under the path thus generated by VS Code:
6574567456nt

If I manually replace the \ with / in the path specification, it no longer has any problems finding the file:
6574567435345456nt

I use Ubuntu-20.04 as WSL 2 and VS Code 1.57.0

@melink14
Copy link

I also noticed the reverse being true, clicking file names in the WSL terminal will trigger a search with all the slashes reversed. Might be unrelated but including in case it's a clue to the larger problem.

@CM000n
Copy link

CM000n commented Aug 16, 2022

Are there any news on this?
For me, unfortunately, this is one of the most annoying behaviors when developping with VSCode under a WSL

@Tyriar Tyriar added terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. and removed terminal General terminal issues that don't fall under another label labels Dec 9, 2022
@Tyriar Tyriar modified the milestones: Backlog, January 2023 Dec 9, 2022
Tyriar added a commit that referenced this issue Dec 29, 2022
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Dec 29, 2022
@rzhao271 rzhao271 added the verified Verification succeeded label Jan 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. verified Verification succeeded windows VS Code on Windows issues WSL Issue when using WSL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants