ConEmu icon indicating copy to clipboard operation
ConEmu copied to clipboard

In an MSYS2 shell, PasteExplorerPath both escapes the spaces and quotes the path, making the path invalid

Open AmaiKinono opened this issue 2 years ago • 0 comments

Versions

ConEmu build: 230724 stable x64 OS version: Windows 10 21H2 x64 Used shell version: MSYS2 ucrt shell

Problem description

When using PasteExplorerPath(1, 0) to paste a path with space in it, e.g., D:\name with space, conemu runs

$ cd "/d/name\ with\ space"

It both escapes the spaces and quotes the path, causing

bash: cd: /d/name\ with\ space: No such file or directory

Steps to reproduce

  1. Open a MSYS2 shell. My setup for the task is:
    set CHERE_INVOKING=1 & set MSYSTEM=UCRT64 & "%ConEmuDir%\msys64\usr\bin\bash.exe" --login -i -new_console:m:"":C:"%ConEmuDir%\msys64\ucrt64.ico"
    
  2. Set a macro to run PasteExplorerPath(1, 0)
  3. In explorer, visit a path with space in it.
  4. Call the macro.

Actual results

Conemu runs

$ cd "/d/name\ with\ space"

Expected results

Either

$ cd "/d/name with space"

or

$ cd /d/name\ with\ space

will do the work.

AmaiKinono avatar Sep 24 '23 06:09 AmaiKinono