Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.51k stars 570 forks source link

Wont run on latest windows insider build (for WSL 2) #1930

Open identityope opened 5 years ago

identityope commented 5 years ago

I've upgraded to WSL 2 and ConEmu can't be started

image

https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/

Versions

ConEmu build: 190331 x64 OS version: Windows 10 Pro Build 18917

Maximus5 commented 5 years ago

Please report this to wslbridge maintainer. ConEmu just run wslbridge to run wsl. https://github.com/rprichard/wslbridge

Have you tried to run wsltty itself?

Maximus5 commented 5 years ago

Perhaps you have done something with /mnt prefix and wslbridge fails to run its backend

identityope commented 5 years ago

It seems like wslbridge is broken after this update, related issues here: https://github.com/rprichard/wslbridge/issues/44 https://github.com/mintty/wsltty/issues/171

Maximus5 commented 5 years ago

The problem is that I'm on slow insider ring and have not received an update yet, so I can't help with fixing

Maximus5 commented 5 years ago

I think I need to force PTY API support and abandon wslbridge

siennathesane commented 5 years ago

I think I need to force PTY API support

I don't think it should be a problem so long as you version lock it to >1903. I'm on 18922, so I can help test it if you need.

LostInBrittany commented 5 years ago

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

tomaspaseka commented 4 years ago

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

I did the same, but arrow keys are not working in vim.

LostInBrittany commented 4 years ago

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

I did the same, but arrow keys are not working in vim.

I have just tested on my computer, they are working for me

LesterCovax commented 4 years ago

To add to @LostInBrittany 's solution, I'd recommend running wsl ~ instead of just wsl. That way you'll start in your WSL home directory instead of your Windows home directory.

I had a hell of a time trying to figure out how to pass commands through using the -e and -- flags mentioned in the --help entry, as they don't seem to work as I expected (and documentation is limited).

This is my new task definition:

And this is my old one using the WSL bridge:

I originally had the chcp 65001 in there to make ANSI support work correctly, but I'm not so sure it's necessary anymore. The cur_console portion is to label the tab "Ubuntu". The boot.sh file contains code (cat /<pathToConEmu>/ConEmu/boot.ans) to echo some ANSI sequences (might not be necessary anymore) to initialize the session correctly. echo -e <ANSI escape sequences> can also be used. Then I have an ANSI splashscreen I made displayed via screenfetch.

LesterWslSplash

inossidabile commented 4 years ago

@LesterCovax nice workaround, thanks. However it's not working too well with Zsh and its magic.

LesterCovax commented 4 years ago

@inossidabile I found out yesterday that it's not working correctly for me either. I was wondering why my color palettes were all screwed up, but it appears if I start the console directly in the account I want, powerline is orange > green > grey like in my previous GIF. If I start the console tab as root in WSL, then su - saitei, it sets it correctly. Not sure if it's a powerline thing or something deeper since all other colors render correctly, and I confirmed the palettes haven't changed.

Incorrect: image Correct: image

Maximus5 commented 4 years ago

@LesterCovax There may be reason for such behavior. If your prompt used 256/true-colors than their support are limited to certain areas https://conemu.github.io/en/Xterm256Colors.html#xterm_256_color_mode_requirements If not - that may be some palette issues or settings.

LesterCovax commented 4 years ago

@Maximus5 it's the same prompt/settings in both scenarios though. The only difference is the entry point...whether I start WSL as root, or directly as my user.

Biswa96 commented 4 years ago

@Maximus5 I have made wslbridge2 project. Those works like in-place replacement of old wslbridge, also works in mintty. But I can't run in ConEmu. May you suggest any steps for that?

There are some bugs (static linking) but I shall fix them quickly.

fpqc commented 4 years ago

@Biswa96 Maximus would need to recompile his connector against the wslbridge2 project.

pacanukeha commented 4 years ago

I did the same, but arrow keys are not working in vim.

Same for me

AurelienCordonnier commented 4 years ago

In agreement with @LesterCovax, edit the task definition by replacing %ConEmuBaseDirShort%\conemu-cyg-64.exe by wsl.exe in Cmder Settings/Startup/Tasks works fine. Probably that don't realy solve the "wslbridge error" encountered directly, but that gives an answer. I don't know if it is the same result as well... I have to mention that works also with debian.exe and I think it will be the same for other distributions.

Prunoideae commented 4 years ago

It worked, but with certain bugs messing with GNU-screen and others.

image

The whole console was just messed up when using ctrl-A + | or other things alike to split screens, and also things like vim is not functional as expected. Also, I tried tmux, upgraded it to version 2.8 and later, but it seemed to be the same as what screen does.

IPWright83 commented 4 years ago

@tomaspaseka did you ever get arrow keys working? I've noticed that they start putting garbage to the console :(

jlschuncke commented 4 years ago

FWIW, the only obvious issue I've discovered in about 10 minutes bashing (literally) around with WSL2 and ConEmu (invoking WSL directly, without a WSL bridge) is thatt less doesn't repaint a screen correctly when backing up a page.

gousaiyang commented 4 years ago

I've just upgraded to Win10 2004, still using WSL1 and see the following error:

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

Arrow keys also don't work in vim when I bypass the wslbridge and directly launch wsl.exe.

(I'm using Cmder with ConEmu 191012).

bkraul commented 4 years ago

With the arrows not working in vim, I found you can still use Alt + [Arrow] to achieve the use of the arrow keys without problems.

jarni-ua commented 4 years ago

Just updated to 2004 build and enabled WSL2. Some of issues as above are same. Neither vim nor less work correctly both adding some random amount of blank lines after exit. But arrow keys work in vim. Colors are somewhat messed up too.

PurplProto commented 4 years ago

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

Worked for getting WSL2 launching, but sadly no backscroll now 😢

JakubJachym commented 4 years ago

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.

sarim commented 4 years ago

I think I need to force PTY API support and abandon wslbridge

Was this implemented in conemu? In this microsoft blog about conpty they mentioned your name.

Edit: After a bit more researching in relevant projects, it seems like cgywin implemented conpty support, so tools from cgywin, ex mintty can run wsl.exe without the previous issues. Is that true? I need to research a bit more and test to understand how & if these parts connect successfully. But does that mean we can discard wslbridge, and run wsl.exe from cgywin connector and have fully functional wsl terminal in conemu?

Maximus5 commented 4 years ago

PTY API is not yet supported by ConEmu. Still needs work on it.

PurplProto commented 4 years ago

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

This workaround has fixed all the issues I've been facing as well. Backscroll now works correctly, less also works again and vim arrows are working too.

TrueXakeP commented 4 years ago

It seems that only mouse scrolling in tmux by "Send mouse events to console" doesn't work with this wslbridge2 solution (just nothing happens although selecting by mouse seems to work). Not a big problem for me, just a reference.

sarim commented 4 years ago

It seems that only mouse scrolling in tmux by "Send mouse events to console" doesn't work with this wslbridge2 solution (just nothing happens although selecting by mouse seems to work). Not a big problem for me, just a reference.

yeah and there are other little stuffs too. Like when tab completing a filename in bash, somehow terminal is not aware of its full width, and line breaks abnormally. Progress bars like apt/wget breaks and starts to print each new % update in new lines.... But these are hard to reproduce, I guess somehow things break after working on a terminal for some time and running different tools creates those side effects .....

Right now i'm using wsltty (mintty), feels very constrained after using conemu.....

PurplProto commented 4 years ago

yeah and there are other little stuffs too. Like when tab completing a filename in bash, somehow terminal is not aware of its full width, and line breaks abnormally. Progress bars like apt/wget breaks and starts to print each new % update in new lines.... But these are hard to reproduce, I guess somehow things break after working on a terminal for some time and running different tools creates those side effects .....

Right now i'm using wsltty (mintty), feels very constrained after using conemu.....

Just come back to mention the same thing. At first, I thought it was down to splitting the window but no matter how many times I did that I couldn't break it. I've tried finding a reproducible pattern but to no avail, nothing seems to consistently break it. It's seemingly random after some time.

ciolansteen commented 4 years ago

Not sure if related, but just this seems to work pretty well for me:

%USERPROFILE%\AppData\Local\wsltty\bin\mintty.exe -s maxwidth -s maxheight --WSL= --configdir="%USERPROFILE%\AppData\Roaming\wsltty" -~  -

-s maxwidth -s maxheight - are required because of this

The loading of mintty into conemu seems pretty slow thou. Not sure if this really is an issue. I remember back in the days I was using conemu with cygwin and this was still present.

sarim commented 4 years ago

The loading of mintty into conemu seems pretty slow thou. Not sure if this really is an issue.

Thats not a solution, that running a whole new program inside conemu, Obviously it'd be slow, if you do that you can just run wsltty ....

Just come back to mention the same thing. At first, I thought it was down to splitting the window but no matter how many times I did that I couldn't break it. I've tried finding a reproducible pattern but to no avail, nothing seems to consistently break it. It's seemingly random after some time.

Yeah, its kinda freaky, you can't reproduce it when testing, but then you start to do actual work and these issues appears out of the wild.

ciolansteen commented 4 years ago

only the startup is slow. compared to simply running wsl in conemu is pretty fast. Try opening a mc in both scenarios and you'll see what i mean. Plus running wsltty / mintty alone is a no go for me. I use conemu mostly because i can have a clean quake style console always connected to my services. And the most seamless working mode i found so far is by running a mintty session inside conemu.

uchagani commented 4 years ago

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

This workaround has fixed all the issues I've been facing as well. Backscroll now works correctly, less also works again and vim arrows are working too.

This works great for me too. Anyone know how to set the starting directory?

saurabh7248 commented 4 years ago

This works great for me too. Anyone know how to set the starting directory?

You can try the following two alternatives:

-w <windows starting folder path>

or

-W <wsl starting folder path>
vishy2907 commented 4 years ago

This works great for me too. Anyone know how to set the starting directory?

You can try the following two alternatives:

-w <windows starting folder path>

or

-W <wsl starting folder path>

Thanks!!!

uchagani commented 4 years ago

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.

FYI, after ConEmu updates you have to reapply this patch.

hyj1991 commented 4 years ago

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.

Thx!!!

ronindesign commented 4 years ago

I run zsh with Oh-My-Zsh, etc and can confirm the above works great (including arrow keys, vim functionality, mouse wheel scrolling in screen, etc). I followed the solutions above, but had simple issues with spaces in the dir paths, so I used quotes. I also created a new folder wsl2 so I can continue to use WSL (ver 1).

I created a new task {Bash::wsl2} with the following commands:

set "PATH=%ConEmuBaseDirShort%\wsl2;%PATH%" & "%ConEmuBaseDirShort%\conemu-cyg-64.exe" "%ConEmuBaseDirShort%\wsl2\wslbridge2.exe" -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l
qurvax commented 4 years ago

When I installed WSL2 and used workaround mentioned above, my WSL1 entry broke. Since there now is some issues with v2, i very much needed v1 running, and without wslbridge i'd get no arrow-keys and other stuff. So I somehow managed to get v1 going by trial_and_error method. Solution to run v1 with v2 installed and wslbridge2 solution applied: set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -d ubuntu-v1 -u v1username -V 1 -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

yihuajack commented 3 years ago

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

Just as supplementary, for the case (WSL1)

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...

this configuration also works!

yihuajack commented 3 years ago

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.

In addition, if showing path error

{PID:575} failed to run shell (2): No such file or directory
{PID:575} shell: `D:\Program` `Files\ConEmu\ConEmu\wsl\wslbridge2.exe` `-eConEmuBuild` `-eConEmuPID` `-eConEmuServerPID` `-l`
{PID:575}   dir: `/cygdrive/c/Users/<username>`

Just add two pairs of quote marks as:

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe "%ConEmuBaseDirShort%\wsl\wslbridge2.exe" -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l
Freelensia commented 3 years ago

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

Thanks a lot. Yes it works. Also if you wanna start with dual consoles then do this: wsl.exe -cur_console:pm:/mnt wsl.exe -new_console:s50H -cur_console:pm:/mnt

silencej commented 3 years ago

wsl.exe

@LostInBrittany Thanks for the hint. A question: entering by "wsl.exe" and type "exit", there will be confirmation waiting:

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

How do you solve this?

silencej commented 3 years ago

wsl.exe

@LostInBrittany Thanks for the hint. A question: entering by "wsl.exe" and type "exit", there will be confirmation waiting:

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

How do you solve this?

Ok, I figured out it myself thanks to https://github.com/Maximus5/ConEmu/issues/1556

The solution is:

wsl.exe -new_console:n
whindes commented 3 years ago

For anyone who is using zsh...these 3 options worked for me. HINT: the -- bash # is the magic to get zsh to run ~/.bashrc which calls zsh in my setup.

run> wsl -l -v #To get -d and -V values

=== OPTION 1 === set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe "%ConEmuBaseDirShort%\wsl\wslbridge2.exe" -W ~ -V 1 -d Ubuntu-18.04 -u <your_v1_user> -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l -- bash

OR === OPTION 2 === set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & wsl.exe wslbridge2.exe -W ~ -V 1 -d Ubuntu-18.04 -u <your_v1_user> -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l -- bash

OR === OPTION 3 === wsl.exe -- bash

jgarrison-evine commented 3 years ago

For anyone who hasn't already resolved this for themselves - I found that installing the version 3.3.0 of wslbridge from https://github.com/mintty/wsltty/releases/tag/3.3.0 resolved my issues.

NOTE: I did already have a special wsltty task setup (maybe I started using wsltty before official support was there in conemu?) Command for the task is: %USERPROFILE%\AppData\Local\wsltty\bin\mintty.exe --WSL="Ubuntu-18.04" --configdir="%USERPROFILE%\AppData\Roaming\wsltty" -~

ryanmaclean commented 3 years ago

Worked perfectly for me, thanks @jgarrison-evine!

I'm on Ubuntu 20.04, so the command is ever-so-slightly different:

%USERPROFILE%\AppData\Local\wsltty\bin\mintty.exe --WSL="Ubuntu-20.04" --configdir="%USERPROFILE%\AppData\Roaming\wsltty" -~