Requesting change how multiple instances behave
Closed this issue · 10 comments
Currently limited to [Options > General > Allow multiple instances].
What I'd like:
- Double-clicking a text file all go to the same instance.
- At the same time being able to open another instance.
E.g., instead of [Options > General > Allow multiple instances], it would be [Options > General > Open files in same instance]. If no, double-clicking each time opens a new instance. If yes, double-clicking opens in either least or most recent instance. The logic whether using the least or most recent instance will have to be defined. I guess the least recent is most intuitive.
You can run a new instance with pn.exe -allowmulti
, it's in pn2.chm.
Note that's actually a double dash preceding the argument (--allowmulti).
Having this arg may be fine for console operation, but not double-clicking.
- Open
%windir%\regedit.exe
- Navigate to
HKEY_CLASSES_ROOT
->*
->shell
- Right-click
shell
->New
->Key
-> "pnAllowMulti
" (without quotes) - Inside
pnAllowMulti
-> double-click(Default)
-> "Edit with Programmer's Notepad (New Instance)
" (without quotes) - Right-click
pnAllowMulti
->New
->Key
-> "command
" (without quotes) - Inside
pnAllowMulti
->command
-> double-click(Default)
-> "C:\Program Files (x86)\Programmer's Notepad\pn.exe --allowmulti "%1"
" (without outermost quotes)
Doing so will allow you to right-click a file and select "Edit with Programmer's Notepad [...]", either in a new or existing instance. For this to work as expected you must also ensure that "Allow multiple instances of Programmer's Notepad to start" is UNCHECKED in Tools -> Options -> General.
[You should always backup the registry before editing it.]
As I understand, just a shortcut that runs pn.exe --allowmulti
is what the OP wants.
Just open shortcut properties and add --allowmulti
to target command, then the shortcut will run the program with that argument when clicked.
As I understand, just a shortcut that runs
pn.exe --allowmulti
is what the OP wants.
No, "double-clicking" any text file is what I initially wanted. Having shortcuts with and without --allowmulti
may be useful as well, but the "right-click a file and select "Edit with Programmer's Notepad [...]"" approach elaborated further above is quite close to what I have been looking for. I guess such standard Windows approach is more suitable than a pn specific approach nobody understands. @veganaize and @anon17 thanks for the input. I will close this issue.
PS: C:\Program Files (x86)\Programmer's Notepad\pn.exe --allowmulti "%1"
should be "C:\Program Files (x86)\Programmer's Notepad\pn.exe" --allowmulti "%1"
(quotes around pn path).
@maettu-this: It worked for me without the quotes around the path.
If you want to open every file in a new instance, you just set the checkbox "Allow multiple instances".