17

I'm on windows 7. Because I work sometimes on long projects I'd like notepad++ to remember the last session instead of me having to save new sessions and load them manually. I set the MISC tab in the settings to remember the last session, but it never does. I installed notepad++ in programfiles and appdata as default. However, everytime I start notepad++ it starts with "new 1". It's extremely annoying. Any way to fix it?

YakovL
  • 7,557
  • 12
  • 62
  • 102
user2314520
  • 347
  • 2
  • 6
  • 11
  • 1
    Have you tried running notepadd++ as Admin then set the MISC tab in Settings menus to "remember current session for next lanuch" by checking the checkbox? – Edper Apr 30 '13 at 00:31
  • Nope doesn't help. I just tried reinstalling it too, no success. This is quite annoying – user2314520 Apr 30 '13 at 00:56
  • Do you have any session oriented plugins installed? I use session manager (as an example) and it produces some undesirable effects to session remembering. I had to turn session remembering off and rely on the session manager. – greyman Apr 30 '13 at 22:49
  • 1
    Also, are you using 64bit win7? – greyman Apr 30 '13 at 22:49
  • yes win7 64bit homepremium. I don't have any plugins installed other than the default ones.Will session manager remember my sessions? – user2314520 May 01 '13 at 02:42
  • Whoa, works now after I installed sessionmanager – user2314520 May 01 '13 at 05:28
  • ... check this link: http://stackoverflow.com/questions/4675202/notepad-setting-for-disabling-auto-open-previous-files – Katax Emperore Oct 12 '16 at 06:17

8 Answers8

24

For me, the resolution was a combination of things. Below is what I did to fix it:

  1. Completely quit out of Notepad++
  2. Deleted the session.xml file found here: C:\Users\XXXX\AppData\Roaming\Notepad++
  3. Open Notepad++
  4. Navigate to: Settings -> Preferences -> Backup
  5. Ensure that "Remember current session for next launch" and "Enable session snapshot and periodic backup" are selected

These items allowed me to get my program to remember previous session, and open where I left off.

Spacenerd
  • 241
  • 2
  • 2
10

Similar to mmp's answer (made a copy of session.xml then deleted the original). I went to Settings -> Preferences -> Backup and placed a checkmark in 'Enable session snapshot and periodic backup'. This caused a new session file to be created in my backup path. Not sure if this was on previously and inadvertently turned off, but I will check with my cat.

Kevin Field
  • 114
  • 1
  • 6
8

I had this issue also (Windows 7). I noticed the ./AppData/Roaming/Notepad++/session.xml file was not being updated when I closed out of Notepad++ and I think it should have been. So, I closed Notepad++, made a copy of session.xml then deleted the original. I then reopened Notepad++, opened a new page or two and closed it and it appears to now be working correctly as the pages were saved (so far). Sounds like maybe the above mentioned "corrupted file" was the issue?

mmp
  • 81
  • 1
  • This fix worked for me, including the latest update to version 6.6.3. +1 – JohnP May 29 '14 at 15:54
  • Perfect! Now it works again :) I also deleted the current files inside of "backup" as it was (of course) filled up with quite a lot of old data. Maybe too full? Btw I am using Win8.1Pro – BAERUS Feb 15 '17 at 16:01
2

Sounds like Notepad++ is being run with the -nosession command line option. Assuming you're starting Notepad++ from a shortcut, delete that option if it's present.

If -nosession isn't present, then something else is either preventing the session from being saved when Notepad++ closes, or from being loaded when Notepad++ starts. Some things to investigate:

  • Using @thirdy's suggestion, run Notepad++ as an administrator and see if it will or won't automatically save and load the session data.
  • Look for the file C:\Users\{your user name here}\AppData\Roaming\Notepad++\session.xml. This is this file where Notepad++ auto-saves the session data. Does its timestamp match the last time Notepad++ was closed? Do the contents of session.xml look corrupted in some way?
  • Make sure the Windows account Notepad++ is running under has read/write privileges in the folder where session.xml resides. It's a long shot, but worth checking.
  • Check the Windows Application log to see if Notepad++ generated any error messages that might shed some light on why the session isn't being saved and/or loaded.
Yennefer
  • 5,704
  • 7
  • 31
  • 44
Chris R. Timmons
  • 2,187
  • 1
  • 13
  • 11
1

Didn't find any help here with my issue which was similar, but realized it on my own. Thought I'd leave an answer in case anyone has the same experience.

If you use CCleaner (my version is 5.79.8704), it will delete the sessions.xml file if you have Notepad++ box checked, and will henceforth not save your sessions. Can't remember if it's checked by default or not. The file can be restored by reinstalling Notepad++, but your last session will of course be lost forever, unless you have a backup copy, which is definitely advisable.

0

My issue occurred when I installed XML Tools plugin. The option "Set XML type automatically" caused the xml file not to be updated.

I disabled(unchecked this option) and the session.xml is now updated automatically.

stingray_
  • 564
  • 5
  • 13
0

You can forgo the complication and trying to figure out the rhyme and the reason by just taking some precautionary steps ahead of time.

The best way to deal with this is as follows:

  1. Open NotePad++ 32 bit.
  2. Export session - File | Save Session (make sure you save the session where you can easily find it.)
  3. Close Notepad 32 bit
  4. Open Notepad 64 bit
  5. Import Session - File | Load Session

Now you have the exact same files opened in 64 bit that were opened in 32 bit. And, if by some buggy chance the session in 64 bit is still deleted, you still have the saved session file that you can use to reload that session.

Scott Tovey
  • 162
  • 3
-1

On the "Find in Files" dialog after Ctrl-Shift-F I had the "Follow current doc." checkbox checked.

Uncheck this and notepad++ will remember the last path you searched.