Skip to content

[Feature request] let -pluginMessage send NPPN_CMDLINEPLUGINMSG without filename #16273

@pryrt

Description

@pryrt

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

When I run notepad++ -pluginMessage="Text" filenamehere when Notepad++ is already running, Notepad++ sends the NPPN_CMDLINEPLUGINMSG notification.

When I run notepad++ -pluginMessage="Text" (with no filename sent on the command line) when Notepad++ is already running, Notepad++ does not send the NPPN_CMDLINEPLUGINMSG notification.

(discussed and confirmed in this Community topic)

Describe the solution you'd like.

Whether or not there are any filenames on the command line, notepad++ -pluginMessage="Text" should send the NPPN_CMDLINEPLUGINMSG notification for plugins to process.

Debug Information

Confirmed in both v8.7.5 with PythonScript 3.0.21 and v8.7.8 with PythonScript 2.1

Notepad++ v8.7.5   (64-bit)
Build time : Dec 21 2024 - 05:13:03
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : OFF
Placeholders : ON
DirectWrite : ON
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Home (64-bit)
OS Version : 24H2
OS Build : 26100.3476
Current ANSI codepage : 1252
Plugins : 
    CollectionInterface (0.0.0.1)
    ComparePlus (1.2)
    DSpellCheck (1.5)
    EnhanceAnyLexer (1.4)
    ExtSettings (1.3.1)
    JsonTools (8.2)
    MarkdownViewerPlusPlus (0.8.2)
    mimeTools (3.1)
    NppConsole (1.2.4.1)
    NppConverter (4.6)
    NppEditorConfig (0.4)
    NppExec (0.8.8)
    NppExport (0.4)
    NppFTP (0.29.13)
    NppLspClient (0.0.31)
    NppUISpy (1.2)
    PreviewHTML (1.3.3.2)
    PythonScript (3.0.21)
    QuickText (0.2.5.1)
    TagLEET (1.3.10.1)
    XMLTools (3.1.1.13)

also confirmed in

Notepad++ v8.7.8   (64-bit)
Build time : Mar  7 2025 - 20:39:25
Path : C:\usr\local\apps\npp\npp.8.7.8.portable.x64\notepad++.exe
Command Line : -pluginMessage="Text" newfile
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : ON
Placeholders : OFF
Scintilla Rendering Mode : SC_TECHNOLOGY_DIRECTWRITEDC (3)
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Home (64-bit)
OS Version : 24H2
OS Build : 26100.3476
Current ANSI codepage : 1252
Plugins : 
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)
    PythonScript (2.1)

Anything else?

Running the following script in PythonScript (2.1 or most recent 3.x) can be used to verify whether or not it's received the

# encoding=utf-8
from Npp import notepad, console, NOTIFICATION
import ctypes

def myFunction(args):
    code = args['code'] if 'code' in args else None
    idFrom = args['idFrom'] if 'idFrom' in args else None
    hwndFrom = args['hwndFrom'] if 'hwndFrom' in args else None
    console.write("notification(code:{}, idFrom:{}, hwndFrom:{}) received\n".format(code, idFrom, hwndFrom))
    if code==NOTIFICATION.CMDLINEPLUGINMSG:
        if idFrom is None: return
        str = ctypes.wstring_at(idFrom)
        console.write("\tAdditional Info: str=\"{}\"\n".format(str))

notepad.callback(myFunction, [NOTIFICATION.CMDLINEPLUGINMSG])

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions