It would be useful if the path pasted from clipboard to a shell was translated to a format that said shell understands if it differs form native windows format.
For example, if user pastes C:\Windows\System\ to PowerShell or cmd it remains unchanged, but in WSL it changes to /mnt/c/Windows/System and in Git Bash to /c/Windows/System.
I wonder if this would be implementable in a generic way such as by having two settings like this for Git bash:
"pathConversionForwardSlashes": true,
"pathConversionRemovePrefix": "C:\",
"pathConversionReplacePrefix": "/mnt/c/"
The prefixes would have to be regular expressions to acount for the fact that C is not the only possible drive letter.
Maybe something like:
"pathConversionExpression": "|([A-Za-z])\(.*)|/mnt/\L$1/$2|"
where $1, $2, ... are capture groups and \L is a lowercase operator (like in Notepad++).
Yeah you're right, I guess full blown regex would be a better solution at that point.
A better solution IMO would be to use the path conversion commands command built into WSL and Cygwin/MSYS2/Git Bash/etc. to convert it for us. So for WSL you would have:
"pathConversionCmd": "wsl wslpath -a $1"
And for Git Bash you could have :
"pathConversionCmd": "\"C:\\Program Files\\Git\\usr\\bin\\cygpath.exe\" -a $1"
Any traction on this issue? It seems small, but this is actually a major roadblock to me switching from cmder to Windows Terminal.
Most helpful comment
Any traction on this issue? It seems small, but this is actually a major roadblock to me switching from cmder to Windows Terminal.