Kill all tabs...relaunch Finder...relaunch TotalFinder...ALL previously killed Tabs/Windows Relaunch/appear?

I’m running Mojave 10.14, if that makes a difference.

I keep seeming to have this problem, consistently.

For whatever reason (not a glitch/necessity, just an occasional choice to do so), I’ll need to relaunch Finder, and here’s what happens:

  1. Relaunch Finder
  2. Relaunch TotalFinder
  3. TF reopens about 12 LONG-AGO-CLOSED Finder Windows.

I do a Command + Option + W

Kills all of the Finder windows.

I repeat the Finder/TotalFinder relaunch procedure above…

The same 12 Finder Windows pop up.

What is going on?

This “Remeber previously open windows/tabs” is a great feature if Finder or my Computer crashes.
HOWEVER, if I’ve PURPOSELY CLOSED these windows, I WANT THEM CLOSED.
TotalFinder should realize this and stop remembering them/relaunching them every time I restart Finder/TF.

It is true that TotalFinder saves “world state” only during graceful termination. If you kill it suddenly it does not get a change to store that info. At this moment I don’t store it speculatively e.g. after closing tabs.

To quit Finder gracefully, you can run this command from Terminal:

osascript -e 'tell application "Finder" to quit'

I could look into it and try to persist the state more frequently. The problem here is that this info is stored in ~/Library/Preferences/com.binaryage.totalfinder.plist and frequent churn in updates to it could cause some other problems - e.g. someone trying to write something from command-line and that would interfere. Maybe it is not an issue. I’m not deeply familiar with plist subsystem in macOS.

I tried to address the issue in TotalFinder 1.11.7:
https://totalfinder.binaryage.com/beta-changes#1.11.7

Every 2s I check for state changes and serialized them into the plist if any.