Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-nosession overwrites settings #3938

Closed
segdy opened this issue Nov 30, 2017 · 5 comments
Closed

-nosession overwrites settings #3938

segdy opened this issue Nov 30, 2017 · 5 comments
Assignees
Labels

Comments

@segdy
Copy link

segdy commented Nov 30, 2017

Description of the Issue

When -nosession is passed as argument, this setting is stored (and overwritten) when exiting the instance. However, -nosession should only be applied for the duration of the session and not stored permanently (if I wanted to have it permanently, I could just change the setting).

I am fairly confident this used to work already but suddently my settings are always reset when I start (a different instance) with -nosession. I think this bug must have introduced some time recently.

A similar issue existed for -notabbar (Bug #5274 on SF) and was fixed.

Background: I would like to use NPP as an advanced editor and as notepad replacement at the same time.

As an advanced editor (when I just execute notepad++.exe) I like the tabs, that my session is saved and that quick new documents are saved in the session althouth the file itself was not saved yet.

As a notepad replacement (which I use for Total Commander) I want a single session (new instance for each file), hence to tabs and and no session management.

For the first case I just use notepad++ as normal, enabling session restoration, tabs etc.

For the second case, when I use

notepad++.exe -multiInst -nosession -notabbar

It seems that the session setting is saved in the global configuration, i.e. it interferes with my "main advanced editor": When I close all instances and just open "notepad++.exe" again, the session setting is suddenly reset.

However, I want that "-nosession" only applies to the new and current instance I start with "notepad++.exe -multiInst -nosession -notabbar".

Steps to Reproduce the Issue

  1. Start notepad++ without command line switches and turn session management on (in "Backup").
  2. Create another instance with notepad++.exe -multiInst -nosession -notabbar
  3. Close both instances
  4. Open notepad++ again without command line switches and the session management setting is reset

Expected Behavior

Command line switches should override configuration but never interfere with them

Actual Behavior

Command line switches interfere with setting (i.e. settings get reset)

Debug Information

Latest version (7.2.2).

@santaranger
Copy link

I second this bug report. I actually came here to raise this exact issue and found this thread.

I have my regular np++ window with my saved session information and activated session snapshot for unsaved files, which is a very handy feature.

Now, I have a special use case where I want a second instance of np++ opening a number of files through a script uising -multiinst/-nosession.

Whenever I close the -nosession instance last, or when the regular instance wasn't open to begin with, the session snapshot setings are reset/deactivated for the regular instance (maybe other settings as well, that I haven't noticed).

I've had this issues ever since I can remember using session snapshots.

I understand np++ has some issues with multiple instances. A quick&dirty fix could be making -nosession instances at least load the same settings as regular instances.

@segdy
Copy link
Author

segdy commented Jan 22, 2018

I just wanted to check if this is something that will be considered to be fixed?

@petenattress
Copy link

I have the same issue, when using Notepad++ as my main text editor and also as Git's core.editor.

In config.xml, you can see the "Backup" GUIConfig option is overridden if you open a second instance of NPP with the -nosession flag and then close it as @segdy describes.

@n-think
Copy link

n-think commented Mar 15, 2018

using np++ for git and this issue is very annoying, pls fix

@VoltairesPuppet
Copy link

I use notepad++ in the same way; advanced editor an notepad replacement. I would like to go a step further though and allow sessions to be stored with reference to "New #" files. At the moment this behaviour is specific to the main session file only.

MichaWiedenmann pushed a commit to MichaWiedenmann/notepad-plus-plus that referenced this issue Jun 27, 2019
When `-nosession` is given as a command line parameter the attribute
`isSnapshotMode` in `config.xml` is overwritten with `no` regardless of
its original value.

    <GUIConfig name="Backup" action="0" useCustumDir="no"
               dir="" isSnapshotMode="yes" snapshotBackupTiming="7000" />

Change this to keep the original value.
@donho donho self-assigned this Aug 2, 2019
@donho donho added the accepted label Aug 2, 2019
@donho donho closed this as completed in b3a6638 Aug 2, 2019
kspalaiologos pushed a commit to kspalaiologos/notepad-plus-plus that referenced this issue Jan 17, 2021
When `-nosession` is given as a command line parameter the attribute
`isSnapshotMode` in `config.xml` is overwritten with `no` regardless of
its original value.

    <GUIConfig name="Backup" action="0" useCustumDir="no"
               dir="" isSnapshotMode="yes" snapshotBackupTiming="7000" />

Change this to keep the original value.

Fix notepad-plus-plus#3938, close notepad-plus-plus#5845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants