Files closing when opening new file

  • Nobody/Anonymous

    This has to be a known issue, but I just couldn't find anything here.

    I love Notepad++, but I end up opening most of my text documents in Notepad because everytime I open a file in Windows explorer, and Notepad++ is not already open, Notepad++ opens the file but all the files I was previously editing disappear and the file I just opened is the only one open. Keeping Notepad++ open at all times and opening N++ manually first just don't work for me.

    Is there a way to make N++ not close all the tabs from previous session?

    • pshute

      pshute - 2006-09-28

      Settings/Preference/Misc. Tick "Remember the current session for next launch".

      • Jay DeKing

        Jay DeKing - 2009-01-13

        Cool! My problem was actually that all previously edited files were opened when I opened a new one, but <i>un</i>checking "Settings/Preference/Misc/"Remember the current session for next launch" was exactly what I was looking for.

        As usual, the answer was hiding in plain sight. Thank you.

    • Nobody/Anonymous

      No, that's not it. It's checked, and it works when I open Notepad++ manually, but when I double-click on a file in explorer that is set to open in N++ and N++ is not already running when I open the file, N++ is launched automatically (like it should), but the tabs from previous session are closed on startup (or not even opened in the first place, I dunno, the point being all of them have to be opened again).

      • pshute

        pshute - 2006-09-28

        OK, I see now.  It happens for me too.

        If I run:
        it's ok.
        If I run:
        notepad++.exe filename.ext
        it loses the tab settings.

        I'm surprised I never noticed it before. Has it always been like this?  If not, I wonder why they changed it.

        A workaround might be to create a batch file to open notepad++ *without* opening the file, and then open it with the file. I.e:
        start notepad++.exe
        start notepad++.exe %1
        That should restore the tabs before it tries to open the file. Then you'd have to fiddle with the file association stuff to make it run the batch file instead of the program.  A nuisance, but if it's really annoying you ...

        • pshute

          pshute - 2006-10-02

          I just tried thid, but I'm getting odd results.  If I just type "start notepad++" it remembers a different set of tabs than if I run it with a shortcut.  I'm running the first command from the same dir as the working dir of the shortcut.

          It appears to be saving this info in session.xml.  I can see one in the dir I'm running "start" in, and one in the program directory.

          How does it decide where to put these?  I'm wondering if this is the root of the whole problem.

        • pshute

          pshute - 2006-09-29

          Actually , this might  not work, or might not be reliable, because the start commands will run asynchronously. I.e the second one might start before the first one has finished opening the program.  Better to put in the full path to the program instead of using the start command.

    • Nobody/Anonymous

      Yes, it does bother a lot, because I usually open files in Notepad now. It has always been like this, and ConTEXT was acted like this too when I was using it.

      Thanks for the tip, I'll try it out later.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks