Closed tetov closed 5 years ago
@Biswa96, I don't see how this is passed to the backend at all or why the env is not separated. Mysterious, however, is how this can happen to one users but not elsewhere...
I was surprised as well to not find other people reporting the same issue..
Before you ask, I have done a complete uninstall including %APPDATA%/wsltty and I have no mintty folder in %APPDATA% or in home folder.
Yes, it was my fault. Apology for the inconvenience 🙇 The PR will fix the environment variable issue. To close window, you can press Ctrl+D twice or enter exit
command. I'll fix it as soon as possible.
@Biswa96 No need to apologize! So happy to get to use wsltty with WSL 2. :)
@Biswa96, I'm confused; you fixed a missing separator, but why was it not missing for me and others?
I fixed those two issues. The test binaries can be downloaded from Appveyor project VS2017 artifacts.
@Biswa96, I'm confused; you fixed a missing separator, but why was it not missing for me and others?
That is because hvpty
and wslbridge
used different method to build the command string.
Also, the argument passing from frontend to backend is not so stable, for example, when you pass --wsldir=~
, then /bin/sh
will automatically expand ~
to home directory, but if you pass --wsldir='~'
, then /bin/sh
will leave ~
unexpanded, and chdir
in hvpty-backend
also do not expand the ~
, then it will fail to process the ~
, while wslbridge
has a resolveCwd
function to expand such thing. Now I rewrite the path processing in hvpty-backend
using wordexp
and it can even process parameters with *
, ?
or environment variables in --wsldir
.
Another issue is not only the problem on separator, it is also on the argument itself. When sh
call a program with ./a.out --env a=b
, then argv[1] == "--env"
and argv[2] == "a=b"
, that can be perfectly handled by getopt_long
, but in the old hvpty, it passed something like ./a.out '--env a=b'
to sh
, causing argv[1] == "--env a=b"
, and getopt_long
think it is only one argument so the argument parsing will fail.
Tried to integrate wslbridge2 v0.4 with wsltty.
WSL V2 invocations fail with
note: backend error output: /mnt/c/Users/towo/AppData/Local/wsltty/bin/hvpty-backend: line 1: syntax error: unexpected word (expecting ")")
if started from the wsltty-installed mintty. From cygwin, however, it works fine. I'm puzzled.
Can you share the installer that you've made?
Did you compile the hvpty-backend with make RELEASE=1
? If I replace it with compiling my own it works well. Try to use musl libc.
I compiled it in Alpine. Which distro do you use?
Me too, Alpine. The size of hvpty-backend is 159 KB with musl but your installer has 1.52 MB.
GRMBL! Works now.
There is a problem in the build process: when invoking the backend build with
cd wslbridge2-$(wslbridgever); cmd /C wsl -d Alpine make RELEASE=1
this would not terminate but finally stall until I press Enter. No idea why.
I tried to workaround this with
cd wslbridge2-$(wslbridgever); cmd /C wsl -d Alpine make RELEASE=1 & (sleep 8; echo built)
which kind of works, except the backend is not copied properly if the build takes too long...
(Trying a more proper workaround that looks for the appearance of the files.)
@mintty
You can use wsl -e xxx < /dev/null
to make it exit after command finished.
Actually wsl.exe
was waiting for some stdin, rawpty can also solve this.
Mine, the wsltty makefile. Thanks for /dev/null.
I fixed those two issues. The test binaries can be downloaded from Appveyor project VS2017 artifacts.
The shortcuts works now for me after I replaced the binaries. The only error I get is chdir: No such file or directory
which I think must be an error in parsing the argument -~
in the shortcut.
Released 3.0.6.
Please recheck the chdir issue.
Hi!
Thanks for all the hard work, I've really missed wsltty since I switched to WSL2.
However, when I try to run wsltty through the newly generated shortcut (with
-h always
added) I get this output:I'm realize that this might not have anything to do with wsltty, but instead with Biswa96/wslbridge2 but since I can run
hvpty.exe
fine on it's own I wanted to check here first.I can't find where the env argument is passed, I would like to try without since this PR on the wslbridge2 repo seems to indicate that something related to arguments passed to hvpty is buggy.
EDIT:
%LOCALAPPDATA%\wsltty\bin\mintty.exe --configdir="%APPDATA%\wsltty" %LOCALAPPDATA%\wsltty\bin\hvpty.exe -W '$HOME' -l
works for some reason, except I can't close the window (as described in this issue).