ConEmu
ConEmu copied to clipboard
The behaviour of pasting a Windows path changed after updating to cygwin 3.1.4 and how to bypas it
Versions
ConEmu build: 191012 x64 OS version: Windows 10 x64 cygwin: 3.1.4
Problem description
With "Allow Windows to POSIX path conversion" on for both paste modes the behaviour of the conversion changed from:
C:\cygwin\home --> /cygdrive/c/cygwin/home
to:
C:\cygwin\home --> /mnt/c/cygwin/home
/mnt doesn't actually exist in cygwin
Steps to reproduce
- Copy a Windows path:
C:\cygwin\home - Paste it on a cygwin shell in ConEmu (CTRL-V, SHIFT-Ins or Right Click)
Actual results
/mnt/c/cygwin/home
Expected results
/cygdrive/c/cygwin/home
How I bypassed the problem
I edited the /etc/fstab file and changed:
none /cygdrive cygdrive binary,posix=0,user 0 0
to:
none /mnt cygdrive binary,posix=0,user 0 0
Restarted all cygwin processes (cygwin, sshd, cron...) and it worked.
So i filled this in case someone had the same problem and doesn't know how to bypass it
Hey @zouhair, thanks for your report. I'm wondering why do you write that this problem has a relation to updating cygwin to 3.1.4? I mean, /mnt was never a default setup for cygwin, it always was /cygdrive since the earliest days of cygwin existence.
Thus I'm wondering what was the real trigger for this problem to occur in your case if you were not hitting it previously. Was it a behaviour change in ConEmu? Or something else?
I tried to pinpoint any changes that happened when this occurred for me but the only thing I could find is the update to 3.1.4.
This is why I didn't state that it was a bug of conemu or cygwin for that matter as I couldn't pinpoint the problem, but it still happened to me and found a bypass and I thought maybe one person had the same problem like me that this may help.
Also hitting this same issue -- thanks for the bypass @zouhair, will give it a shot (actually I don't want it to do anything except convert the slashes from windows to unix, but that might be a bridge too far).
I think I figured out a workaround, For you those of you who need the /cygdrive prefix, add -cur_console:pm:/cygdrive to the command that launches your task. In my case, by default the paste rewrite maps to /mnt/c/... when it should be mapping to /c/.... So I realized I could fool it into doing this by replacing that with two double quotes instead, e.g.:
"C:\Program Files\Git\usr\bin\bash.exe" --login -i -cur_console:pm:""
And that's despite not being able to find documentation on it anywhere (e.g. even on the -new_console and cur_console documentation page), so I'm just fumbling around here, unfortunately. I really couldn't find a thorough explanation of what the heck -cur_console really did, nothing on what the pm subparameter was or means, why it's formatted that way, etc... I just stumbled upon it after wading through the XML configs and found the /mnt path hiding in a WSL task command.
Even though I really don't want this path rewriting, it should at least work now... 😑
Contributions to documentation are appreciated. I did my best to explain all parameters of the -cur_console. For now I don't see anything that is not clarified there.
Both p and m parameters are described.
I see now @Maximus5, sorry about that and thank you. Direct link to the syntax: https://conemu.github.io/en/NewConsole.html#syntax The key switch here is actually m (not a); at first I thought the pm was it's own switch 😄 Going back even as far as 2017, it looks like the default for this was still /mnt, so I guess this wasn't the part that changed, but could at least help alleviate @zouhair's issue until the cause of the change is uncovered.
It seemed the root cause was tracked down successfully. Any chance that this could be fixed in a future version?