Community
    • Login

    Request for a new command line switch --singleInst

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 3 Posters 319 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pbarneyP
      pbarney
      last edited by

      There is currently a command line switch to load a second instance of Notepad++ (-multiInst).

      But if we have “always in multi-Instance mode” turned on in Preferences → Multi-Instance, then there is no way to open a document from the command line or a shortcut without starting a new session.

      I would like to propose a new -singleInst command line switch in order to open a file into the existing instance when Multi-Instance is enabled.

      I realize that this presents a potential difficulty of choosing which instance to open a file into when multiple instances are open, but perhaps there is an internal identification system for each instance that can be specified? For example, to load a file into the second instance, you could use:

      -singleInst [instance ID|PID]

      Thoughts?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R
        last edited by

        @pbarney said in Request for a new command line switch --singleInst:

        Thoughts?

        Mine wold be to remove that preference setting, thus no multi Instance set. Then have 2 shortcuts, one with the multiInst and one without. Run which ever is appropriate.

        Given it is so easy to set it up in this manner I doubt the developers would consider coding changes to suit this request, if you were to place it on GitHub for consideration.

        My 2 cents worth
        Terry

        1 Reply Last reply Reply Quote 1
        • PeterJonesP
          PeterJones @pbarney
          last edited by

          @pbarney ,

          I believe that this is similar to what @Hans-v-Buitenen asked for in https://community.notepad-plus-plus.org/topic/19875/add-commandline-parameter-for-no-multiinstance .

          I can see some benefit to being able to say “add this to specific instance X of notepad++.exe”, but as you say, there may be implementation difficulties.

          As I recommended in the other post, while this forum is great for getting initial reaction to a new idea, in the end, this isn’t the official feature request site.

          As far as implementation goes, you chose “PID” as a possible identifier; that and hWnd stick out at me as good choices – but for either one, Notepad++ would have to make it dead-easy (like adding it to the Debug Info) for any user to know what that ID was for a given Notepad++ window. But, at the point that you’ve clicked back into the specific instance of Notepad++ to find out its ID, you’ve entered the situation where “isn’t it easier for you to just copy the path of the folder you’re in from cmd.exe, then click into the chosen instance of Notepad++ and File>Open, paste in your path, and choose the file?” – if you’re going to click in Notepad++ anyway, why not use Notepad++ do open the file in the instance of your choice.

          I do understand that there might be a circumstance like using a batch file to automate distributing certain groups of files among various instances of Notepad++, like in the other thread I referenced. But then there’s the workaround I suggested there (craft a session XML file, and load that session, so you get all the files at once)

          Unfortunately for those of you who are asking for it, often times suggestions that have workarounds that don’t require a new feature often get told “just use the workaround”. But maybe your post and Hans’s post will work toward drumming up enough support that Notepad++ developers will decide it is worth it.

          Good luck.

          pbarneyP 1 Reply Last reply Reply Quote 2
          • pbarneyP
            pbarney @PeterJones
            last edited by

            @PeterJones

            It was a wishlist item and my wishlist doesn’t trump pressing needs. Too often the perfect is the enemy of the good.

            I don’t know what’s involved in ongoing Notepad++ development, and whether it would have been a, “hey, good idea, I’ll whip that together in 10 minutes and be done with it” or if it would be, “hmm, we’ll put together a committee to do a needs analysis prior to committing it to the product roadmap and tasking several developers to develop the unit tests and blah blah blah.”

            Either way, my life is 90% workarounds, so I’m fine with it.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors