Repository navigation
Description
On several occasions I've experienced that when I leave my computer for a while and come back, all my terminal windows are gone.
After some investigation I've reached the conclusion that this happens because the app was installed through the Microsoft store, and just received an update.
This is probably fine for your average note taking app or Candy Crush game, but for a terminal with several tabs open that do actual work (and perhaps even long-running (like several days) processes open in remote SSH sessions) this is completely unacceptable.
Is there a way to avoid the terminal being restarted after receiving an update through the Store? A notification would be fine to let me know that I should restart it on the earliest convenient moment, but having it just disappear can in the worst case scenario cost me days of work that will need to be restarted, and in the best case some inconvenience and a few minutes to get back to where I was before...
Luckily a workaround exists: disable apps auto-updating (https://support.microsoft.com/en-us/help/15081/windows-turn-on-automatic-app-updates), but is there really no better way of handling this?
Environment
Windows build number: [Version 10.0.18362.418]
Windows Terminal version (if applicable): 0.7.3382.0
Steps to reproduce
Do normal everyday work in terminal, wait for an update to arrive.
Expected behavior
A notification to restart the app at my earliest convenience, or that the app continues to run with the old version, and that all new instances are started as the new version (like in Linux, where executables linger on in RAM until closed regardless of whether the file they started from still exist).
Or at the very least that it would notify me that new updates were available, but not install them.
Actual behavior
Terminal windows suddenly disappear with no explanation whatsoever, before I open the Store app and see that it was just now updated...
Sorry if this issue seems a bit salty, but it's really annoying - right up there with getting to the office in the morning to continue where you left off yesterday, only to find out that the PC rebooted automatically to install Windows updates (hint: not cool).
Activity
tovine commentedon Dec 11, 2019
Actually, the way you're doing it for Visual Studio Code is perfect - why not use the same approach here if possible? :)
mg-christian-esser commentedon Dec 13, 2019
+1 I just lost hours worth of state because of this behavior.
bozhodimitrov commentedon Jan 9, 2020
The other way around is also not good.
Previously I had a lot of errors in my Event Viewer from Windows Update about the fact that Windows Terminal can't be updated, because the executable is running.
We need a better process of updating the app. And it would be nice if we have some kind of configuration options like: automatic restart after update - on/off and so on :)
mg-christian-esser commentedon Jan 14, 2020
Just having automatic updates install upon next launch would be a perfectly fine behavior.
CaptFrankSolo commentedon Feb 15, 2020
Also note, there is a massive difference in these experiences:
please, on behalf of developers everywhere with long build times, consider moving us more and more to #5
emusgrave commentedon May 18, 2020
Dustin L. Howett (MSFT) (@DHowett-MSFT) I see that you've mentioned this issue from other closed issues but you have not actually commented here regarding the problem or the intention to fix it. I was about to open a new report because this issue also doesn't capture the entire story. But instead I'll post some findings here and hope that you can shed some more light on what the plans are.
First, the problem is not just that the console sessions are silently closed when the program automatically updates. I haven't been able to fully trace what set of circumstances causes this, but I've had processes just get orphaned. The only reason I even realize this is that when I go to re-open one of my command line processes, I see that the listening port is still in use and I can't open it. I've then had to go searching through TCPView and Process Explorer to find the orphaned process and kill it.
Second, I tried to circumvent all of this by installing the Terminal app via Chocolatey. However, it still gets updated via the Windows Store!? I'm not sure why that would happen if I did not install via the Store.
At the very least I would LOVE an option to disable automatic updates. Another solution might be to tie all updates to Terminal to the next Windows reboot cycle? But I think from your comments on other threads this is what you aren't able to do when distributing via the Store.
I would also make the recommendation to just not distribute this application on the Windows Store. This is not really an ideal app for that delivery mechanism. This is a power user / developer targeted app, so I would think it would be distributed more like Visual Studio or Visual Studio Code, or even Power Toys.
Thanks for your teams work on this app. Unfortunately I am going to have to abandon it until this issue is fixed because I'm losing a lot of time and work every other week when an update is pushed and my long-running processes are lost.
DHowett commentedon May 18, 2020
You've got the critical points down pat.
For right now, it's possible to extract the msixbundle (and the architecture-specific msix inside it) and run WindowsTerminal.exe directly. We're not intending on breaking this. 🤞
emusgrave commentedon May 18, 2020
Dustin L. Howett (@DHowett) Thank you for the quick response!
I went ahead and uninstalled my existing copy of Terminal (thereby unlinking it from the Windows Store), and am now running it directly from the exe extracted from the package you referred to. Appears to work the same, although the version number in the about box is listed as 0.11.200512003-release1.0.
Hopefully this helps some others who are struggling with the automatic updates. I will keep an eye on the repo so that I can perform my own updates manually.
sba923 commentedon Jul 27, 2020
So you did not install from the msixbundle available from the 'Releases' page?
That's what I just did, and how Store reports the app is 'installed'... so I expect it will still be subject to (auto)updates. Correct?
Can you please elaborate on how you got a runnable instance deployed without Store considering it's installed (and thus needs updating)?
TIA
emusgrave commentedon Jul 28, 2020
Stéphane BARIZIEN (@sba923) You can "unzip" the msixbundle, and then just run the exe from there. I copied the folder to Program Files and added it to my PATH env for extra convenience.
I have had no problems with auto-updates since doing it this way. I watch the github project for any releases that have fixes/features that I want.
sba923 commentedon Jul 28, 2020
Thanks for the tip!
I chose not to add the folder to the PATH, because that's not absolutely required (and I have a theory where adding tons of app folders to the PATH would slow down the system...).
Something worth mentioning: uninstalling will delete
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalStatewhere thesettings.jsonfile is located (I know, that's part of the "good" sandboxing idea beyond store app deployment), so you'll lose your settings if you don't make a copy first.In the "XCOPY-deployed" instance, the
settings.jsonfile resides at%LOCALAPPDATA%\Microsoft\Windows Terminal.HTH
2 remaining items
RowdyChildren commentedon Feb 13, 2021
Seeing this issue as well, its very annoying.
aaroneg commentedon Feb 14, 2021
DHowett commentedon Feb 14, 2021
DHowett commentedon Feb 14, 2021
Defer package updates while the Terminal is running
Defer package updates while the Terminal is running (#16250)
Defer package updates while the Terminal is running (#16250)