Skip to content

Regression: NppShell open multi-files on Notepad++ multi-instance mode #36

@donho

Description

@donho

Bug report:
notepad-plus-plus/notepad-plus-plus#13778

Here is illustration to turn Always in multi-instance mode option ON:

image

The correct/legacy behaviour with Always in multi-instance mode option ON is:
If Notepad++ is launched manually N times, there should be N instances of Notepad++ open.
Here the scenario:

  1. Firstly user selects A.txt & B.txt via Explorer, then right-click to run Edit with Notepad++, the 1st instance of Notepad++ will be launched, and contains both A.txt & B.txt.
  2. Secondly user selects X.txt, Y.txt & Z.txt via Explorer, right-click to run Edit with Notepad++, the 2nd instance of Notepad++ will be launched, and contains both X.txt, Y.txt & Z.txt.

Such legacy behaviour has been verified in an old version (v8.3.3) of Notepad++, and the result is as expected.
Here's its debug info:

Notepad++ v8.3.3   (64-bit)
Build time : Mar 13 2022 - 17:20:02
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\eula.2052.txt" "C:\eula.3082.txt" "C:\globdata.ini"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Pro (64-bit) 
OS Version : 2009
OS Build : 19045.2604
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll

However, after updating Notepad++ from v8.3.3 to v8.5.3 (and restart Explorer process), then open the same 3 files via Edit with Notepad++, 3 instances has been opened, and each instance contains 1 file:

Instance 1:

Notepad++ v8.5.3   (64-bit)
Build time : May 15 2023 - 06:09:36
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\eula.2052.txt"
...

Instance 2:

Notepad++ v8.5.3   (64-bit)
Build time : May 15 2023 - 06:09:36
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\eula.3082.txt"
...

Instance 3:

Notepad++ v8.5.3   (64-bit)
Build time : May 15 2023 - 06:09:36
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\globdata.ini"
...

Manually launch Notepad++ v8.5.3 from command line, by keeping Always in multi-instance mode option ON:
notepad++.exe "C:\eula.2052.txt" "C:\eula.3082.txt" "C:\globdata.ini"
3 files are opened in the same instance, and here its debug info:

Notepad++ v8.5.3   (64-bit)
Build time : May 15 2023 - 06:09:36
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\eula.2052.txt" "C:\eula.3082.txt" "C:\globdata.ini"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Pro (64-bit)
OS Version : 22H2
OS Build : 19045.2604
Current ANSI codepage : 1252
Plugins : 
    mimeTools (2.9)
    NppConverter (4.5)
    NppExport (0.4)
    NPPJSONViewer (1.40)

Conclusion:
NppShell launches N times Notepad++ if N files are selected in Explorer - It is not correct: NppShell should launch notepad++.exe only once and pass the file paths altogether to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions