WSL stops opening in Windows Terminal after a while #17665

Closed
opened 2026-01-31 05:49:25 +00:00 by claunia · 7 comments
Owner

Originally created by @srcdecay on GitHub (Jun 9, 2022).

Windows Terminal version

1.12.10983.0

Windows build number

10.0.22000.0

Other Software

WSL Ubuntu, ssh

Steps to reproduce

  1. Boot into Windows, open a Terminal tab that runs wsl.exe -d Ubuntu with \wsl.localhost\Ubuntu\home\username as starting directory. I also have a terminal tab that runs the command "ssh username@myserver" when it's opened.

  2. Wait some amount of time (unclear when it breaks)

  3. Open a new WSL tab

Expected Behavior

Windows Terminal opens a WSL shell tab

Actual Behavior

A new Terminal tab is opened, but it just has a flashing cursor and won't start the WSL process.

I am still able to open WSL through a command prompt or powershell by running "wsl -d Ubuntu", and Terminal still opens my both my elevated and unelevated powershell tabs with no issues.

This just started to happen a couple weeks ago, and I had not made changes to my configuration before it started happening. Windows and WSL are up to date, as are all of my Ubuntu packages.

The solution is to run "wsl --shutdown" from an elevated command prompt or powershell, but eventually the terminal won't open again and I need to keep rerunning "wsl --shutdown". Rebooting the system also works. Closing and reopening the Terminal application does not help.

Originally created by @srcdecay on GitHub (Jun 9, 2022). ### Windows Terminal version 1.12.10983.0 ### Windows build number 10.0.22000.0 ### Other Software WSL Ubuntu, ssh ### Steps to reproduce 1. Boot into Windows, open a Terminal tab that runs wsl.exe -d Ubuntu with \\wsl.localhost\Ubuntu\home\username as starting directory. I also have a terminal tab that runs the command "ssh username@myserver" when it's opened. 2. Wait some amount of time (unclear when it breaks) 3. Open a new WSL tab ### Expected Behavior Windows Terminal opens a WSL shell tab ### Actual Behavior A new Terminal tab is opened, but it just has a flashing cursor and won't start the WSL process. I am still able to open WSL through a command prompt or powershell by running "wsl -d Ubuntu", and Terminal still opens my both my elevated and unelevated powershell tabs with no issues. This just started to happen a couple weeks ago, and I had not made changes to my configuration before it started happening. Windows and WSL are up to date, as are all of my Ubuntu packages. The solution is to run "wsl --shutdown" from an elevated command prompt or powershell, but eventually the terminal won't open again and I need to keep rerunning "wsl --shutdown". Rebooting the system also works. Closing and reopening the Terminal application does not help.
Author
Owner

@zadjii-msft commented on GitHub (Jun 9, 2022):

That makes... no sense. I have no idea what could possibly cause that. We might need a better repro here, unfortunately. There's not much we can do with "I do something but I have no idea what, and WSL doesn't work". Have you reported this on the WSL repo/? You might get better debugging tips from the WSL team.

@zadjii-msft commented on GitHub (Jun 9, 2022): That makes... no sense. I have no idea what could _possibly_ cause that. We might need a better repro here, unfortunately. There's not much we can do with "I do something but I have no idea what, and WSL doesn't work". Have you reported this on the WSL repo/? You might get better debugging tips from the WSL team.
Author
Owner

@srcdecay commented on GitHub (Jun 9, 2022):

I have not reported it to the WSL repo but I will do that.

Unfortunately, it's more or less impossible to get a more detailed
reproduction of it. It just seems totally random, but always happens. I
always have the same applications running on my PC, so my best guess is a
recent update to one of them made something wonky. But that doesn't make a
lot of sense either.

It's so weird that wsl works when run from a command prompt, but terminal
opening it directly doesn't work. I've gone through syslogs and tried to
track what's happening down, but gremlins don't leave logs. I can't find
anything.

Thanks for the response. I'll get on to reporting it to the WSL repo in a
bit. I hope they can help. It's not a deal breaker of a bug (wherever that
bug may lie), it's just annoying, and annoying bugs are the worst bugs.

@srcdecay commented on GitHub (Jun 9, 2022): I have not reported it to the WSL repo but I will do that. Unfortunately, it's more or less impossible to get a more detailed reproduction of it. It just seems totally random, but always happens. I always have the same applications running on my PC, so my best guess is a recent update to one of them made something wonky. But that doesn't make a lot of sense either. It's so weird that wsl works when run from a command prompt, but terminal opening it directly doesn't work. I've gone through syslogs and tried to track what's happening down, but gremlins don't leave logs. I can't find anything. Thanks for the response. I'll get on to reporting it to the WSL repo in a bit. I hope they can help. It's not a deal breaker of a bug (wherever that bug may lie), it's just annoying, and annoying bugs are the worst bugs.
Author
Owner

@lhecker commented on GitHub (Jun 10, 2022):

When you write:

I am still able to open WSL through a command prompt or powershell by running "wsl -d Ubuntu"

Are you saying that WSL still works if you start it from outside of Windows Terminal and it opens a window like this?
image

I can remember that I had similar issues with WSL for a short period of time but it's been at least a year since...

@lhecker commented on GitHub (Jun 10, 2022): When you write: > I am still able to open WSL through a command prompt or powershell by running "wsl -d Ubuntu" Are you saying that WSL still works if you start it from outside of Windows Terminal and it opens a window like this? ![image](https://user-images.githubusercontent.com/2256941/173085068-0f7ab431-e730-4e33-adeb-14950030a62f.png) I can remember that I had similar issues with WSL for a short period of time but it's been at least a year since...
Author
Owner

@srcdecay commented on GitHub (Jun 10, 2022):

I can start it through Windows Terminal after it breaks, but it needs to be invoked from a powershell or command prompt tab by running "wsl -d Ubuntu". The issue is with the tabs that directly invoke wsl.exe. If I run Ubuntu from the start menu, it does open a window that looks like yours, only it doesn't properly apply my zsh themes because it has issues with loading certain fonts.

I had a problem about a year ago when I was running Windows 10 where wsl would shut down at random. I was running the Ubuntu command from the start menu at the time and the Ubuntu command would quit working at some point during my session. The solution was to run wsl.exe on a command prompt to restart the service, then Ubuntu would work again. A bit of a different problem, but similar enough (though unrelated to Windows Terminal).

@srcdecay commented on GitHub (Jun 10, 2022): I can start it through Windows Terminal after it breaks, but it needs to be invoked from a powershell or command prompt tab by running "wsl -d Ubuntu". The issue is with the tabs that directly invoke wsl.exe. If I run Ubuntu from the start menu, it does open a window that looks like yours, only it doesn't properly apply my zsh themes because it has issues with loading certain fonts. I had a problem about a year ago when I was running Windows 10 where wsl would shut down at random. I was running the Ubuntu command from the start menu at the time and the Ubuntu command would quit working at some point during my session. The solution was to run wsl.exe on a command prompt to restart the service, then Ubuntu would work again. A bit of a different problem, but similar enough (though unrelated to Windows Terminal).
Author
Owner

@Trass3r commented on GitHub (Jun 13, 2022):

Are you using the latest WSL version from the store?

@Trass3r commented on GitHub (Jun 13, 2022): Are you using the latest WSL version from the store?
Author
Owner

@srcdecay commented on GitHub (Jun 14, 2022):

I don't use the store, but I installed WSL from the command line with the
"wsl --install --distribution Ubuntu" command and I update it with "wsl
--update" every couple of weeks.

As far as I can tell, Windows 11 is up to date, WSL is up to date, and
Terminal is up to date.

@srcdecay commented on GitHub (Jun 14, 2022): I don't use the store, but I installed WSL from the command line with the "wsl --install --distribution Ubuntu" command and I update it with "wsl --update" every couple of weeks. As far as I can tell, Windows 11 is up to date, WSL is up to date, and Terminal is up to date.
Author
Owner

@zadjii-msft commented on GitHub (Jul 7, 2022):

Sorry this fell off the triage queue. I'm gonna go ahead and say this needs to be reported over at https://github.com/microsoft/wsl. It doesn't seem like an issue that'd be caused by the Terminal, and they'd be better equipped to get to the root cause of this.

Sorry for the delayed response!

@zadjii-msft commented on GitHub (Jul 7, 2022): Sorry this fell off the triage queue. I'm gonna go ahead and say this needs to be reported over at https://github.com/microsoft/wsl. It doesn't _seem_ like an issue that'd be caused by the Terminal, and they'd be better equipped to get to the root cause of this. Sorry for the delayed response!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17665