mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.12k stars 104 forks source link

wsltty immediately closes when using WSL1 distro #267

Closed ypnos closed 3 years ago

ypnos commented 3 years ago

I'm running Windows 1909 (Build 18363.1256) and installed WSLTTY 3.4.4

I have several distros installed, WSL1 and WSL2.

"Debian" is the default distro and running in WSL1, while "Debian2" is a copy of said distro running in WSL2.

(base) PS C:\Users\jordajo\AppData\Local\wsltty\bin> .\mintty.exe --WSL="Debian" (base) PS C:\Users\jordajo\AppData\Local\wsltty\bin> .\mintty.exe --WSL="" (base) PS C:\Users\jordajo\AppData\Local\wsltty\bin> .\mintty.exe --WSL="Debian2"

The first two calls open a mintty window with no text that instantly closes. (However, if the distro was previously terminated, it changes status to "Running" in wsl --list -v output.) The third (WSL2 distro) opens a window and a shell prompt appears. It then works as expected.

mintty commented 3 years ago

Works here, with newer Windows version. In terms of Windows update policy, 1909 is quite an old version, maybe you'd like to test with an update?

ypnos commented 3 years ago

Unfortunately, I am currently stuck with this version.

I forgot to mention that it worked once after installing wsltty, but stopped working after I terminated the distribution.

mintty commented 3 years ago

There were similar problems before. Maybe you have an older version of wslbridge2 in your path? What does where wslbridge2.exe say if you cd to the wsltty installation directory (not the bin subdirectory)?

ypnos commented 3 years ago

It says nothing.

mintty commented 3 years ago

@Biswa96, any idea?

Biswa96 commented 3 years ago

@ypnos Did any of wsltty version from 3.4.1 to 3.4.3 work?

ypnos commented 3 years ago

Before I had version 3.0.2.3 (as it was the last one that supported my even more ancient previous Windows version). It did not work with Windows 1909 anymore, that's why I tried 3.4.4 and it worked only once.

Which version would you recommend me to try?

ypnos commented 3 years ago

Sometimes there is text in the terminal that starts with "note:" ... I cannot read more as the window instantly vanishes.

Biswa96 commented 3 years ago

Windows 10 version 1909 is not in the blacklist. Can you open the %LocalAppData%\wsltty\bin folder in Command Prompt and run wslbridge2.exe -d Debian (and with Debian2)? What did you see? Are you using any Docker related software?

ypnos commented 3 years ago

I get:

PS C:\Users\jordajo\AppData\Local\wsltty\bin> .\wslbridge2.exe -d Debian note: backend error output: /bin/sh: 1: exec: /mnt/c/Users/jordajo/AppData/Local/wsltty/bin/wslbridge2-backend: Permission denied

... and this also solved the issue!

Problem was that executable permissions were not set for wslbridge/wslbridge2 binaries in that directory. I set them now with chmod and it works!

For reference, I use this wsl.conf:

[automount] enabled = true options="metadata,dmask=033,fmask=133,uid=1000,gid=1000,case=off,noatime"

Thank you for your help. I really hated having to use Windows Terminal instead. WSLTTY has better font rendering and feature set.

Biswa96 commented 3 years ago

Actually, I did not even help a little bit 😄

mintty commented 3 years ago

To be precise, you set chmod +x wslbridge-backend on the WSL side? So did you add WSL distributions after installation of wsltty?

mintty commented 3 years ago

If my suspicion is confirmed, this is likely a duplicate of #163. Note the following in section Configuration of the project page:

The Start menu folder WSLtty contains the link configure WSL shortcuts. This function is initially run when wsltty is installed. If should be rerun after adding or removing WSL distributions, in order to create the respective set of shortcuts in the Start menu.

ypnos commented 3 years ago

I did re-run the install script several times but my real problem was that at first I had set the mount options with "fmask=133" but without "metadata". At some later point I understood my mistake and added "metadata", but as I didn't see the connection to wsltty, at this point I did not re-run any scripts. Thank you for your time!