Open kalaschnik opened 4 years ago
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.
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.
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.
Same, it does not like the -d operation... hmm
@rescenic Well, how does this solve anything regarding the issue (i.e., open a desired folder location using shell menu)?
Yeah, doesn't work for Cygwin & MSYS2. My bad. It works for WSL, CMD, PowerShell.
Same issue is happening for Git Bash.
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 containscygwin
in thecommandline
property. I’m not a Powershell scripter, so it woud take too much time for me.