-
Notifications
You must be signed in to change notification settings - Fork 315
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
New WSL session loses focus on startup #998
Comments
@bobf32, thanks for reporting the issue, I do not observe the issue reported, After launching the mintty, the new "Ubuntu-20.04" window open, then the focus is moved to that window from the window launched mintty, So if I type something from keyboard, the input goes to newly opened "Ubuntu-20.04" window, as below shows as I typed "hello". Is this the expected behavior? thanks! |
That's pretty much it, but I can simplify. To reproduce:
The window housing the command prompt and now bash session somehow loses focus at this point, and I have to alt-tab or click in it to type into the terminal. Mintty was a red herring, not required to reproduce this. Further invocations of |
@Bob32, I still don't observe the focus lost with wsl.exe, but starting up WSL with guiApplications enabled involves launching msrdc.exe in background, so it possible that the focus is changed by that, although it might vary by other factors such as host Window's version. Would you please share log files from /mnt/wslg? I would like to double check if there are some unexpected errors, thanks! |
Sure, please see attached. |
@bobf32, thanks for sharing the log, and I do see some clue there, below line in your log indicates there is some UI being created in Linux side, and this is most likely the reason of focus change, and for me, I don't see this until I actually run some GUI apps, like firefox, do you have some custom script to run at startup? thanks!
|
I have a .bashrc but nothing else that I am aware of. And this does not start any gui stuff I don't think. I don't tend to use gui apps with wsl. |
@bobf32, is it possible you can install fresh distro and see if same issue still occurs? and if you have any customization made by c:\Users\[your user name]\.wslconfig or /etc/wsl.conf, please share with us, thanks! |
I have just installed a fresh copy of Ubuntu 22.04.2 LTS and the problem still occurs. Problem occurs now in two distros, and in both cases whether .wslconfig exists or not. In neither case do I have /etc/wsl.conf. |
@bobf32, thanks for trying out. I think, at this point, I will need to have some additional instrumentation to understand this further, and at same time, I will be checking if any repro internally, I will post here if any updates, thanks! |
@bobf32, update: I'm able to reproduce the issue on Windows 10 (while I cannot on Windows 11), and it looks you are on Windows 10 as well, and in this case, the window focus is moved to a window created by msrdc.exe (msrdc.exe is indirectly launched by wsl.exe in background). Do you happen to have separate environment on Windows 11? if so, please check if this does not occur on Windows 11, thanks! |
Thank you for the update @hideyukn88. I am indeed on Windows 10 but have not got a Windows 11 environment right now. I'll try and spin up a VM when I get some time. |
The fix for this focus lost issue went into msrdc.exe code, thanks! |
@hideyukn88 Great, is it available yet? What do I need to do to get the fix? |
I'm having this problem. It doesn't seem like this fix has been released yet? Is there an ETA? |
@hideyukn88 That's great news! How does msrdc.exe get updated? Can I do anything to get it now (maybe |
I'm having this exact issue on Windows 11 |
I'm currently still having this issue on Windows 11, WSL2 Ubuntu, and :
doesn't fix it |
I have this issue too and it's extremely easy to reproduce when simply switching between distros.
For reference, I'm on a fresh Windows 11 install (fresh from employer, that is) version |
Windows build number:
19045.2604
Your Distribution version:
22.04
Your WSL versions:
WSL version: 1.1.3.0
Kernel version: 5.15.90.1
WSLg version: 1.0.49
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2604
Steps to reproduce:
See mintty/wsltty#329
WSL logs:
No response
WSL dumps:
No response
Expected behavior:
No response
Actual behavior:
On starting a new WSL session, the focus should be set to the window containing that session. This is not the case.
The text was updated successfully, but these errors were encountered: