xilun / cbwin

Launch Windows programs from "Bash on Ubuntu on Windows" (WSL)
Other
327 stars 25 forks source link

No terminal support #36

Open ghost opened 7 years ago

ghost commented 7 years ago

I know I can use ssh to connect directly to running machine or even use virtualbox GUI to connect to the running virtual machine, but sometimes it is more convenient to be used as such. Currently if I try to wrun vagrant ssh or wrun ssh it gives me:

Pseudo-terminal will not be allocated because stdin is not a terminal.

ghost commented 7 years ago

I've also noticed that if I start cmd.exe, it works properly(except for ctrl-c), but if I run wrun vagrant ssh -- -t -t that forces terminal allocation, it seems to be broken like it does not send back some escape sequence

xilun commented 7 years ago

I don't know vagrant, but I will attempt to give it a try. From which environment did you tried wrun vagrant ssh or wrun ssh? Directly from console created by outbash.exe (without extra screen/tmux involved) or from anything else?

ghost commented 7 years ago

Well usually using tmux, with pure outbash console situation is slightly different, as it correctly detects STDIN as terminal, and ssh session starts. However, it is not usable, as for example, if I type command, it hangs, no output can be seen. Ctrl-C terminates the session(instead of passing it down to ssh)

xilun commented 7 years ago

In a tmux you don't have access to the windows console API (stdin/out/err are redirected), so the only way to support it would be something like injecting a DLL into all spawned processes that would convert the windows console API calls to VT stuff (if that's possible at all, I'm not even sure). I'm almost certain that I'm not going to do that, but if anybody want to contribute that kind of craziness I'll look at the patch :)

For the directly in a console scenario, I'll soon add some GetConsoleMode() and SetConsoleMode() calls, that, I think, will improve the situation.

xilun commented 7 years ago

I've not tested directly with vagrant but the result with wrun cmd in a console after commit ab86dc8 is quite good... on the last insider build - but not really usable on the Anniversary Update :/

So I'm unsure something usable can be achieved on the Anniversary Update, in which WSL is a beta version anyway.

ghost commented 7 years ago

Ok, so I've solved this radically: fell back to ubuntu for development