-
Notifications
You must be signed in to change notification settings - Fork 797
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
running Windows process from the background opens a new terminal window in WSL preview #7568
Comments
Does this happen using system's WSL after uninstalling the preview one? |
@Biswa96 I've installed/uninstalled the preview a few times to verify that this only happens with the preview (0.48.2.0). |
Thanks for reporting this @sakai135. Where is wsl.exe starting from in this context ? Can you share screenshots ? |
@OneBlue The behavior is the same running the command in Windows PowerShell or the Bash shell in WSL 2 Ubuntu. With the non-preview WSL, the terminal window for ping.exe will not open. |
Just to update that this is still an issue with the new update:
|
I have the same issue with same versions. except in my case I experienced by running shell_exec commands from php running in wsl to run an exe file . and it led to a wsl terminal to open. doesn't happen with shell commands only windows commands. such as cmd.exe route.exe ..etc running the same commands from inside an opened wsl terminal doesn't open new one. only from the background. I tried to put the script inside a .sh file and run the sh file from php. but same results. I can confirm that I didn't experience the problem before preview from the store. but my kernel was very outdated and custom. |
Since this issue still hasn't seen any interaction from MS, I'd like to indicate that this issue still persists on the newest build of Windows 11 when using the WSL Preview from the Microsoft Store. WSL version: 0.51.2.0 |
@sakai135 I had a deeper look and I could reproduce the problem. This situation this is basically a race between the time the 'ping.exe' process is created and the wsl 'process group' being terminated. If this 'wsl.exe' has terminated, then the process is created by wslhost.exe, which isn't attached to the console, which is why ping.exe creates a window as you reported. So if you do:
wsl.exe might terminate before the process actually starts on the Windows side. If you do:
Then the issue doesn't apply because the wsl process group doesn't terminate. I need to give some thoughts to this, I'll update this issue when I'll have a solution in mind. |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Version
Microsoft Windows [Version 10.0.22478.1012]
WSL Version
Kernel Version
5.10.60.1
Distro Version
Ubuntu 20.04
Other Software
WSL version: 0.48.2.0
Repro Steps
Run the following command:
Expected Behavior
I expect ping.exe to run in the background without opening a cmd window like in the current (non-preview) WSL.
Actual Behavior
With WSL preview (0.48.2.0), the command opens a new terminal for ping.exe.
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: