Open bobf32 opened 1 year ago
Does it also happen if you start wsltty the "regular" way? (e.g. via desktop shortcut, or from the Start Menu) Is it the window from which you start it that regains the focus? Maybe it "steals" the focus for some reason?
Sounds as if being related to https://github.com/mintty/mintty/issues/1113 but more analysis is needed, as that issue was assumedly fixed. Do you type anything quickly after starting wsltty?
There were some 'focus' related issue in GUI part of WSL2 also, see https://github.com/microsoft/WSLg/issues?q=is%3Aissue+is%3Aopen+focus. Make sure if the issue can be reproduced after disabling GUI feature with WSL2.
Does it also happen if you start wsltty the "regular" way? (e.g. via desktop shortcut, or from the Start Menu) Is it the window from which you start it that regains the focus? Maybe it "steals" the focus for some reason?
I am starting wsltty from shortcut. The path I posted originally is that of the shortcut. Wherever focus goes, it is not back to the window that had focus immediately before.
Sounds as if being related to mintty/mintty#1113 but more analysis is needed, as that issue was assumedly fixed. Do you type anything quickly after starting wsltty?
I don't really understand the question. I start a terminal session because I want to start typing, but I can't because I have to manually set focus first. I don't recall ever having to do this before.
There were some 'focus' related issue in GUI part of WSL2 also, see https://github.com/microsoft/WSLg/issues?q=is%3Aissue+is%3Aopen+focus. Make sure if the issue can be reproduced after disabling GUI feature with WSL2.
How would I do that?
How would I do that?
Add the following lines in %USERPROFILE%\.wslconfig
file.
[wsl2]
guiApplications=false
More info https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig
How would I do that?
Add the following lines in
%USERPROFILE%\.wslconfig
file.[wsl2] guiApplications=false
More info https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig
Thanks. That does indeed fix the issue. And as I am still able to run gitk I wonder if, as I am running Windows 10, there is a downside.
Can you see the issue with wsl.exe when those lines are not present in .wslconfig file?
Can you see the issue with wsl.exe when those lines are not present in .wslconfig file?
Yes. Without guiApplications=false
, wsl --shutdown
followed by wsl.exe
at a powershell prompt causes focus from the PS console window to be lost.
So, this does not look like mintty/wsltty issue, right? You can see those issues in wslg repository.
So, this does not look like mintty/wsltty issue, right? You can see those issues in wslg repository.
Seems fair.
Windows 10 Pro 22H2 Build 19045.2604 wsltty 3.6.1.2
Every so often, but not all the time, when I start a new session the newly opened window does not have focus.
The problem doesn't occur every time I start a wsltty session, but these steps seem to be repeatable:
wsl --shutdown
%LOCALAPPDATA%\wsltty\bin\mintty.exe --WSL="Ubuntu" --configdir="%APPDATA%\wsltty" -~ -
Actual result: A new wsltty window appears, but the window does not have focus.
Expected result: the new window has focus on opening.