Windows-terminal-context-menu icon indicating copy to clipboard operation
Windows-terminal-context-menu copied to clipboard

Directory Paths not working for Cygwin

Open kalaschnik opened this issue 4 years ago • 7 comments

Cygwin maps Linux POSIX paths to Windows Path and prefixes the current path with /cygdrive/

That means, assume you are in this folder: C:\Users\Username\git\project the corresponding cygwin path would be /cygdrive/c/Users/Username/git/project

Could you prepend the /cygdrive/ if a users defines an id which contains cygwin in the commandline property. I’m not a Powershell scripter, so it woud take too much time for me.

kalaschnik avatar May 10 '20 17:05 kalaschnik

One question is how to identify a profile is Cygwin environment? Because this profile is added by user, it's not easy to guarantee a fixed pattern.

kerol2r20 avatar May 11 '20 02:05 kerol2r20

Either by checken the commandline property with a regular expression as cygwin by default has its own name included in the install directory (i.e., cygwin64 or cygwin32) see here:

Windows Terminal’s settings.json:

{
    "guid": "{07ece1cb-ff14-4179-a738-1781081fd8be}",
    "hidden": false,
    "name": "Cygwin",
    "icon": "C:/cygwin64/Cygwin-Terminal.ico",
    "commandline": "c:/cygwin64/Cygwin.bat",
    "startingDirectory": "/cygdrive/d",
    "backgroundImage": "%OneDrive%/.config/.assets/cygwin.png",
    "backgroundImageOpacity": 0.1
},

Or you could also allow a user to set a flag, in case the go crazy and change cygwin names to something different:

This project’s config.json:

"{07ece1cb-ff14-4179-a738-1781081fd8be}": {
    "icon": "cygwin.ico",
    "isCygwin": true
},

I think the latter option is safest.

kalaschnik avatar May 11 '20 07:05 kalaschnik

These two way are good! Have you tried to open wt.exe with /cygdrive/c path?

I tried `wt.exe -p "Cygwin" -d /cygdrive/c/". But it did not worke.

kerol2r20 avatar May 12 '20 11:05 kerol2r20

Same, it does not like the -d operation... hmm

kalaschnik avatar May 12 '20 14:05 kalaschnik

@rescenic Well, how does this solve anything regarding the issue (i.e., open a desired folder location using shell menu)?

kalaschnik avatar Jun 23 '20 05:06 kalaschnik

Yeah, doesn't work for Cygwin & MSYS2. My bad. It works for WSL, CMD, PowerShell. wsl

rescenic avatar Jun 23 '20 16:06 rescenic

Same issue is happening for Git Bash.

Akshay-akkay avatar Aug 26 '20 04:08 Akshay-akkay