Menu

[Feature request] Session command args

Bertie
2008-05-08
2012-11-13
  • Bertie

    Bertie - 2008-05-08

    The "-nosession" command line argument, starting Notepad++ without loading the default session, is nice, but it still updates the default session upon exit. Is it possible to change the behaviour so that Notepad++ leaves the session.xml intact when started with "-nosession"?

    My intention is to have a short-cut on my quick launch bar that start up Notepad++ WITH a session containing a bunch of files I very often use. But in addition I often use the context menu to view/edit various files, but then I would like a "clean" Notepad++, WITHOUT session, every time (-multiInst)!

    I've noticed the nppcm has a registry setting "Multi" that adds the "-multiInst" command line argument when launching Notepad++ from Context Menu (at least the 64-bit version from Harry B. har it). I would love to have "-nosession" added as a registry setting also! This way context menu can launch "Notepad++.exe -multiInst -nosession", while my quick launch shortcut just launches "Notepad++.exe" with no arguments (if -nosession wouldn't destroy my default session).

    An additional feature I would love is a new command line argument that opens a custom session XML-file other than the default one! I've seen others mention this too in this forum. It would probably solve much of the problems described above, but such a new command line argument would probably not make Notepad++ automatically save the given session upon exit? If not, then the default session functionality described above would still be very nice to have!

     
    • Bertie

      Bertie - 2008-05-09

      Excellent, Harry! :)

       
    • Fool4UAnyway

      Fool4UAnyway - 2008-05-08

      You may be referring to or be interested in these threads:

      "Session autosave?" (Open Discussion forum)
      http://sourceforge.net/forum/forum.php?thread_id=1946436&forum_id=331753

      "Save and load sessions: some peculiarities" (Open Discussion forum)
      http://sourceforge.net/forum/forum.php?thread_id=1980813&forum_id=331753

      I think it would be a logical thing to:
      - don't mess with any session file if the -nosession argument/parameter is used
      - should (open and) save to the same session file passed as parameter when implemented
      - should only open and save to the default session file if this option is checked in preferences and Notepad++ is opened with none of the other parameters -nosession and let's call it -sessionfile

      Alternatively, -sessionfile might also be used to open without any session by entering no session filename at all.

       
    • Bertie

      Bertie - 2008-05-09

      I agree 100% with your list! It would be very usefull to have the described functionality in Notepad++!

       
    • Harry

      Harry - 2008-05-09

      ill see if I can add -nosession to the context menu :)
      Maybe the 32 bit needs these kind of things too, but since it didnt have any, I didnt document anything :)
      I dont know if Don wants to put it in the installer though