[PR #11625] Automatically convert paths dropped on WSL instances #28671

Open
opened 2026-01-31 09:29:59 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/11625

State: closed
Merged: Yes


Drag and drop does not work for WSL because paths are pasted as windows
paths having incorrect path separator and path root. This PR adds code
to correct the path in TerminalControl before pasting to WSL terminals.

One problem with this approach is that it assumes the default WSL
automount root of "/mnt". It would be possible to add a setting like
"WslDragAndDropMountRoot"... but I decided it if someone wants to change
automount location it would be simple enough just to create the "/mnt"
symlink in WSL.

Validation

Couldn't find an obvious place to add a test. Manually tested
cut-n-paste from following paths:

  • "c:"
  • "c:\subdir"
  • "c:\subdir\subdir"
  • "\wsl.localhost<distro>"
  • \wsl.localhost<distro>\subdir"

Closes #331

**Original Pull Request:** https://github.com/microsoft/terminal/pull/11625 **State:** closed **Merged:** Yes --- Drag and drop does not work for WSL because paths are pasted as windows paths having incorrect path separator and path root. This PR adds code to correct the path in TerminalControl before pasting to WSL terminals. One problem with this approach is that it assumes the default WSL automount root of "/mnt". It would be possible to add a setting like "WslDragAndDropMountRoot"... but I decided it if someone wants to change automount location it would be simple enough just to create the "/mnt" symlink in WSL. ## Validation Couldn't find an obvious place to add a test. Manually tested cut-n-paste from following paths: - "c:\" - "c:\subdir" - "c:\subdir\subdir" - "\\wsl.localhost\<distro>" - \\wsl.localhost\<distro>\subdir" Closes #331
claunia added the pull-request label 2026-01-31 09:29:59 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28671