[GH-ISSUE #117] [FEATURE] Support for custom prefixes for WSL paths #115

Closed
opened 2026-02-25 21:32:40 +03:00 by kerem · 2 comments
Owner

Originally created by @iliazlobin on GitHub (Apr 12, 2020).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/117

Originally assigned to: @clechasseur on GitHub.

Currently, when you choose "Copy WSL" option, the "/mnt" prefix is added to the full path. Sometimes, users prefer having folders mounted to the root location (or others but /mnt). The /etc/wsl.conf file lets to control this behaviour:

[automount]
enabled = true
root = /

Having this set, the copied path would have the wrong value:

  • /mnt/c/path/to/my/file instead of /c/path/to/my/file

I found where it's hardcoded in one of the project's source code files, and have managed to edit it and recompile it for myself so that I have a correct path.

However, I believe, that this has to be configurable. Enabling a custom text field in settings (with a default value of /mnt) would be the best option for everybody.

Originally created by @iliazlobin on GitHub (Apr 12, 2020). Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/117 Originally assigned to: @clechasseur on GitHub. Currently, when you choose "Copy WSL" option, the "/mnt" prefix is added to the full path. Sometimes, users prefer having folders mounted to the root location (or others but `/mnt`). The `/etc/wsl.conf` file lets to [control this behaviour](https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/): ```conf [automount] enabled = true root = / ``` Having this set, the copied path would have the wrong value: * `/mnt/c/path/to/my/file` instead of `/c/path/to/my/file` I found where it's hardcoded [in one of the project's source code files](https://github.com/clechasseur/pathcopycopy/blob/master/PathCopyCopy/plugins/src/WSLPathPlugin.cpp#L33), and have managed to edit it and recompile it for myself so that I have a correct path. However, I believe, that this has to be configurable. Enabling a custom text field in settings (with a default value of `/mnt`) would be the best option for everybody.
kerem 2026-02-25 21:32:40 +03:00
Author
Owner

@clechasseur commented on GitHub (Apr 13, 2020):

I agree that it could be configurable. But in your case, isn't this exactly what the MSYS Path command does?

<!-- gh-comment-id:612696702 --> @clechasseur commented on GitHub (Apr 13, 2020): I agree that it could be configurable. But in your case, isn't this exactly what the MSYS Path command does?
Author
Owner

@clechasseur commented on GitHub (Jul 4, 2020):

I've added a hidden setting to configure this. In the HKEY_CURRENT_USER\Software\clechasseur\PathCopyCopy registry key, setting the WSLPathPrefix value will override the default /mnt.

This will be available in the next version.

<!-- gh-comment-id:653716377 --> @clechasseur commented on GitHub (Jul 4, 2020): I've added a hidden setting to configure this. In the `HKEY_CURRENT_USER\Software\clechasseur\PathCopyCopy` registry key, setting the `WSLPathPrefix` value will override the default `/mnt`. This will be available in the next version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pathcopycopy#115
No description provided.