-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spawns another shell (only one term) with WSL2 #197
Comments
Does it also happen with WSL1? What does happen in CMD and wsl.exe? |
What exactly do you claim about the terminal? I see smaller font size in the screenshot but it could simply be a matter of presentation. Whatever behaviour you are reporting, is it different with a previous version of mintty/wsltty? Can you demonstrate it without zsh please, and maybe even isolate it from using tmux? Otherwise at least a screen log would be helpful. |
WSL1 and wsltty 3.0.5 no problem with same code. @mintty and no .bashrc PID 34 ? |
WSL2+CMD: I appended the code in |
So you reproduce, 2 process, when you attach to current session you get the low resolution tmux ? |
In my .zshrc I test |
Understand. I did every steps that you have provided but can not see any defect in case of WSL2+wsltty. |
Ok, Cannot now (no wsl2 on this PC), will try it at home later |
In the video, I see you have a full-screen terminal, later start another terminal window, and resize it to full-screen. |
How do you leave the initial tmux session? With ^D/exit or by closing the terminal window? |
When I do the test I reset lxmanager so I kill all wsl process |
Which may well cause zombie processes to remain. |
I do that cause exit do the same..., on a fresh reboot that do the same too... |
Don't understand. When you terminate a process with exit, it will be properly cleaned up. When you force-close it by killing itsk platform, it may not. Particularly with tmux, it's its purpose to catch that and not terminate, so you shouldn't be surprised that you're left with pending processes. |
I said, what ever you do to close the term exit/ctrl+d/close windows/restart lexmanager service, have the same issue the result is wrong with wsl2+ mintty 3.0.6 and good with wsl1 + mintty, wsl1 without mintty, wsl2 without mintty |
OK, it is possible that closing a tmux session behaves differently in WSL 2 for some obscure reason. |
It's just running with wsl2 + mintty open 2 tty client for one windows. |
Let me try to interpret: You want 2 mintty windows for a WSL 2 distribution, with tmux running in each? |
As a side note, if you always want tmux to wrap your session, you could perhaps set it up as your shell; or you could Let us isolate a minimal test case. You login (start WSL), no .zshrc magic, invoke tmux explicitly, leave its shell with Anyway, as I said, I don't see any relation to the terminal. Just curious what could make such trouble in your exotic setup. |
that is my test with bash no ? chsh with /bin/bash I get 2 bash pts client |
And that without any .bashrc |
with default shell /bin/bash for me I must start a fresh wsltty and get only one If I'm wrong tell me. |
Normally, yes. So with WSL 2 you get 2 bash processes already? |
Sorry for confusing, with newer Windows account (name: neko), I forgot to switch the WSL version. log
|
Actually WSL2 was already mentioned in the issue title; I changed it according to current analysis. |
I'm having the same problem after upgrading to WSL2. Any way I can assist the troubleshooting process?
|
@Biswa96, it is related to the "$(wslpath -u ...)". If I replace that with a fixed string as an experiment, it does not happen. I'll check how we can do without it in general. |
Thanks for the quick reply. In the meantime, is there any workaround possible? |
No; the issue is not really severe. |
@seowalex Depending on the situation, but |
I have the same problem with Ubuntu 18.04, WSL2, wsltty 3.2.0. I noticed it because sometimes tmux would not read its config, and I couldn't figure out why. I start tmux in
I added these lines at the beginning of my # work around https://github.com/mintty/wsltty/issues/197
if [[ -n "$WSL_DISTRO_NAME" ]]; then
command -v cmd.exe > /dev/null || return
fi and now I see this at startup, which fixes all practical problems I was having:
|
In case the comparison helps, this is what the process tree looks like when I open an Ubuntu terminal in Windows Terminal:
|
That "workaround" does not change anything for me. Also, the issue is sufficiently narrowed down for further handling. |
Any updates on this issue? |
Updates would appear right here. |
Hi, That progress in investigation but it's still invalid issue? |
It's a wslbridge2 issue but that's a component of wsltty, so that assessment wasn't quite proper. |
I have made a local patch to wslbridge2, allowing option |
I had this issue as well, which prevented me from building a npiperelay between an OpenSSH Authentication Agent on the windows side and consumers of the SSH_AUTH_SOCK on the Linux side. Only thing I changed, was to replace |
Thanks for the hint, I added it to the wsltty project page. |
Thanks! For those who wonder, here is the whole shebang for getting the Windows OpenSSH Authentication Agent service connected to WSL2, I have that sourced from my .zshrc / .bashrc:
This is a slightly modified version of the example given in the wsl-ssh-agent repo. As mentioned there you will need npiperelay. This complicated version uses dynamically allocated ssh-agent-sock names. I wrote that, because of the superfluous shell discussed in this issue, where the fixed socket was blocked and the startup hung. Maybe with the workaround from wjrogers the original proposal would now also work. |
I think I have fixed this issue. Compile wslbridge2 or download the binaries from Appveyor CI artifacts. The issue was nothing fancier. I just forgot to close the sockets, one of my typical programming mistakes. |
Released 3.4.1. |
This reverts commit 8050efb.
Hi there,
Just try the new release 3.0.6.
And with WSL2 I have another tmux client.
I had this code at the end of my .zshrc :
I commented the
exit 0;
to debug why the wsltty windows exited.So with only one terminal I got a zsh term (not the needed tmux session) and I see a tmux client connected :
if I attach the session I got this:
So another unknow tmux term with low size connected.
That explain why my term exited with the
exit 0;
but that code work since a long time.I can change the code to keep 2 clients but that broke the size of all automatic initialized tmux sessions. I have to kill 'TMUX' session and recreate it, not a good deal...
The text was updated successfully, but these errors were encountered: