Enable Session Snapshot and Periodic Backup Box Unchecked
Hi, the thread at Running multiple instances of Notepad++ with regular autosave kind of turned into an editorial on unsaved “new 1” tabs before the issue at hand was addressed.
I’d like to revive the discussion about the “Enable session snapshot and periodic backup” checkbox becoming unchecked. It doesn’t seem like a desirable behavior, regardless of how the feature is meant to be used.
I rarely use multiple instances of NPP. Every time I do, the session snapshot and periodic backup box becomes unchecked. Re-checking the box restarts backups immediately, and in the specified directory, but the box comes unticked after an indeterminate amount of time regardless of whether I’ve opened a second instance of NPP since the last occurrence.
I’m glad to provide more information.
If you are running (as you said in the old thread) with
-multiInst -notabbar -nosession, then “Enable session snapshot and periodic backup” will turn off for that instance. But once you’ve closed that instance (or those instances) and started a new single-instance, it should go back to using the session snapshot / periodic backup. At least, it has worked just fine for me the few times I fire up a multiInstance/nosession.
If it doesn’t go back to your main settings, you’ll probably have to find a repeatable sequence of events that triggers the bug every time. Posting that sequence here, we might be able to tell you what you’re doing wrong, or interpret the “why” it behaves the way it does. Barring that, we may be able to give you a workaround. If you post it to the official issues page (see this FAQ for more info), with enough detail, and if it’s a repeatable bug, it might get fixed.
My first gut-reaction guess is that after you’ve opened the
-multiInst -notabbar -nosession, then you do something which edits (and saves) the main settings in the nosession version. If your settings get saved with the -nosession flag, then of course sessions (and thus session snapshot) will be disabled on all subsequent runs. You might be able to watch
%AppData%\Notepad++\config.xmlfor modifications (the snapshot checkbox seems to be in
<GUIConfig name="Backup" ...>'s
"yes"attribute; the Remember Current Session setting seems to be stored in
<GUIConfig name="RememberLastSession ...>"). If confirmed, then my advice would be “don’t change settings that get stored in
config.xmlif you’re using multiInstance/noSession mode”.
Here’s what I’ve found. (I have no command line arguments running)
Open two documents
Right click on the tab of one document for the context menu
Pick “Move to New Instance”
Close the original instance
Close the new instance
“Enable session snapshot and periodic backup” is now unchecked
If you view the setting in both the original and new instance before closing anything, the setting is checked in the original and unchecked in the new.
If you close the new instance first, then close the original instance, the setting remains checked.
So I’ll ignore the real topic of this thread, but maybe I won’t go totally off-topic…
I’d like to ask what people find so useful about being able to run multiple instances of Notepad++. Okay, so there might be some obvious things about this (that I should know and in reality likely do), but I’m gonna “play dumb” and see what people respond with, if anyone cares to.
Thank you for the clear sequence: I was able to reproduce your issue with 7.5.8 32bit. You are right, that does seem strange behavior.
I believe I can interpret it: the original was opened with session-snapshot enabled (obviously). When you split out a tab to a new instance, NPP probably internally used the
-multiInst -nosessionsettings. So now you’ve got two instances of NPP – the original with session, and the new without session. When you close the original, it compares its settings with the
config.xml, doesn’t see a difference, so just exits. When you close the new, it compares its settings with the
config.xml, sees a difference, saves a new
config.xmlwith session-snapshot disabled, and exits. Thus, when you reload, it now has session-snapshot disabled.
I am not sure there would be a way to fix this, because I am not sure how NPP could tell the difference between “I was intentionally opened with -nosession, and my user wants me to save that setting for the future” (which is the current behavior), and “I was unknowingly opened with -nosession, and my user will be very confused if I save that setting for the future”… because really, all NPP knows is “I have sessions disabled, the
config.xmlclaims sessions are enabled, so I need to overwrite that setting to match my current state.”
If you want the developer to have a better chance of finding out about this , I would suggest following the instructions in this FAQ to make an official bug report. Feel free to link to this topic, and/or quote my interpretation paragraphs. I’m not sure how a compromise could be made between the two reasons for the internal state, but the developers, knowing the guts of the program much better than I, might be able to come up with something.
@Scott-Sumner I use it this way periodically to compare to files visually on screens, side by side. I often use the compare plug-in too, but sometimes I need to have two separate windows.
@PeterJones Now that I’ve nailed down the ‘why’ and the ‘how to avoid’ and the ‘how to fix when I forget to avoid’, I understand the why and feel content.
I use it this way periodically to compare to files visually on screens, side by side
Have you tried the secondary view feature to keep things within a single instance? (Right-click a tab and choose Move to Other View).