Text Editor: session management across transient use
Currently Text Editor has a session manager built into it to restore your previous session upon the next application launch.
Where this was breaking down was when users open a file using Nautilus and then close it. Clicking on another file in Nautilus would re-open Text Editor with both the previous file (if they closed with the window's Close button, as there is no tab) and the new file. As users continue to do this, they pile up new tabs.
- See GNOME/gnome-text-editor#278 (closed) for some background
To make this somewhat better, Text Editor now avoids restoring/saving session state when you launch Text Editor via Nautilus by opening a file (or launching via the command-line as it's the same internal flow). This feels a bit more natural to me, but it has the unintended side-effect of discarding your previous session.
For those using Text Editor in more complicated ways (generally programming) that could be a bit annoying as they'd have to re-open files into their session. Thankfully, we have quick and easy [Ctrlk keyword Return] to make that flow pretty easy.
- See GNOME/gnome-text-editor#307 (closed) for some background
Another option could be to treat the "opened-via-nautilus" case as a transient session only and only restore the session upon next launch of Text Editor. If so, that'd bring up two oddities:
- You have to quit to re-open and get back to your session
- Or we'd need some sort of "restore my previous session now" menu item that is only visible from the transient state
- Just restore the previous session always when launching from Nautilus
However, I do think it makes sense to see if what we've done already is the least bad of the options, because that's how I feel about it right now.