34

Since I have updated windows, my conemu terminal is giving me the following error each time a session is created:

wslbridge error: failed to start backend process
note: backend error output: -v: -c: line 0: unexpected EOF while looking for matching `''
-v: -c: line 1: syntax error: unexpected end of file

ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...

Has anyone an idea to bring conemu to a wsl terminal? Thank you

Martin J
  • 2,019
  • 1
  • 15
  • 28

5 Answers5

42

A similar error is caused by upgrading WSL from v1 to v2.

If you read through the discussion on this github issue for ConEmu you'll find a variety of instructions that can be distilled into:

Change the command for the task {Bash::bash} to the following:

wsl.exe
Scotty.NET
  • 12,533
  • 4
  • 42
  • 51
  • Wow. That answer was to the point. The only uncertainty left is all the `ConEmuBaseDirShort` stuff in the original task. – Pascal Oct 02 '20 at 06:34
  • 1
    Have you tried running wsl without it? It is no longer necessary for myself. Read through the GitHub ref as there are many different user scenarios, including using `-w` for setting starting folder, `--bash` for loading a .bashrc file. – Scotty.NET Oct 02 '20 at 07:39
17

A GitHub user posted this workaround which worked for me:

I've fixed the issue by doing this:

  1. Download latest cygwin1-20200531.dll.xz from https://cygwin.com/snapshots/ and unpack the file as cygwin1.dll into ConEmu\wsl\ (replacing the original file there)
  2. Download @Biswa96's wslbridge2 from https://github.com/Biswa96/wslbridge2/releases and unpack to the same directory
  3. Replacing {WSL::bash} task's Command with:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

I can now access my Ubuntu under W10 just like before the W10 upgrade. Backscroll and arrows in VIM work as expected.

The key part of step 3 is to replace conemu-cyg-64.exe --wsl with conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe.

Longer term, it looks like the author of ConEmu is working on switching to the new Windows PTY API, which will eliminate the need for the wslbridge hack (and many others) entirely.

josh3736
  • 139,160
  • 33
  • 216
  • 263
  • Looks like you don't need step 1 now -- there's a `cygwin1.dll` in the archive that comes down with step 2. Regardless, this work-around is still working, so thank you! – Jeff Sep 29 '20 at 12:57
2

I had the same issue with last update windows

(Feature update to Windows 10, version 2004 - Successfully installed on ‎9/‎1/‎2020)

the error does not seem to be related to the version of WSL from 1 to 2:

   $ wsl -l -v
    
     NAME            STATE           VERSION
    
    Ubuntu-20.04    Running         1

Nevertheless, this workaround worked for me as well, thank you so much!

1

Exactly this goes through upgrading WSL from v1 to v2.

You have to open cmder and in the startup command or Task enter {wsl.exe} and ready

cmder is working again.

0

Yes, the new command for WSL2 is much simpler, but just running wsl does not cause .profile to be read because launching this way does not request login shell, and it launches as root.

A better command is to specify the user id and to invoke the shell of your choice (bash is most common) with the appropriate option. For bash a login shell is desirable so .profile, .bashrc and .bash_aliases get sourced, if present. The -l (lower case L) does that:

wsl -U yourUserName bash -l
Mike Slinn
  • 7,705
  • 5
  • 51
  • 85