314

enter image description here

How do I stop Notepad++ from loading all files from the past session?

Every time I open a file I have 10 other open tabs with all my past files. I don't want that. When I hit the close button I expect the program to do what I want and close it. If I wanted to save a session I would use the built in session save feature. I don't want to hit the gray x 20 times when I am done so next time I don't have a bunch of files opening and taking up memory.

I tried the -nosession parameter and that works. But it only works if I use the shortcut. It won't work if I use the right-click edit method. How do I set Notepad++ to do this?

Kara
  • 5,650
  • 15
  • 48
  • 55
DantheMan
  • 6,577
  • 6
  • 30
  • 35

7 Answers7

564

For versions 6.6+ you need to uncheck "Remember the current session for next launch" on Settings -> Preferences -> Backup.

this is it in 6.6+

For older versions you need to uncheck "Remember the current session for next launch" on Settings -> Preferences.

this is it

jhurtado
  • 8,201
  • 1
  • 21
  • 34
  • 8
    @jhurtado -- After opening a *very* large file in Notepad++ and restarting, the application freezes... can I "disable" auto-opening by deleting the Notepad++ cache? – Ian Campbell Dec 17 '14 at 16:25
  • 10
    Thanks, solved my problem. BTW, "BACKUP "is a weird name for an option about auto load recent file......Just wondered why the developer named it. – RRTW May 22 '17 at 07:41
  • 11
    this should be a default setting. No one wants the old stuff to keep coming up – user32882 Aug 22 '17 at 12:30
  • 2
    Backup options seems a weird place to put that particular option. – Steve Crane Oct 29 '18 at 07:34
56

In Notepad++ v6.6 this setting is moved to the Backup tab of the Preferences menu.

enter image description here

YWE
  • 2,749
  • 25
  • 40
  • 2
    I added your response to the original answer :) – jhurtado Jun 05 '14 at 23:07
  • 26
    Oh, the BACKUP tab, of course that's where I should find settings related to launch. How stupid of me. – pseudocoder Oct 22 '14 at 16:25
  • 2
    I agree with your sarcastic remark, pseudocoder. I looked around in the program quite a bit before coming here for the answer. I never would have thought backup had anything to do with this (as it's not backup related, though there is a session backup option). – DAG Mar 15 '16 at 16:25
48

My problem was that Notepad++ was crashing on a file I had previously opened; I was unable to open the application at all. This blog post discusses how to delete the data from the "Sessions" file so that Notepad++ will open without having any prior files open:

From the blog post:

Method 1 - edit session.xml

  1. Open file session.xml in C:\Users\Username\AppData\Roaming\Notepad++ or %APPDATA%\Notepad++
  2. Delete its contents and save it
  3. Run Notepad++ , session.xml will get new content automatically

Method 2 - add the -nosession parameter to Notepad++ shortcut

  1. Create a desktop shortcut referring to your Notepad++ program, e.g. C:\Program Files\Notepad++\notepad++.exe
  2. Right click on this shortcut
  3. In the "Target" field add the -nosession parameter so the target field looks exaxtly like (apostrophes included too): "C:\Program Files\Notepad++\notepad++.exe" -nosession
  4. Save and run Notepad++ from this shortcut icon with no recent files

Note: This is not a permanent setting, this simply deletes the prior session's information / opened files and starts over.

Alternatively, if you know the file which is causing notepad++ to hang, you can simply rename the file and open notepad++. This will solve the problem.

I hadn't seen this solution listed when I was googling my problem so I wanted to add it here!

Shrout1
  • 2,027
  • 4
  • 35
  • 61
  • 4
    This was perfect for my similar situation; I closed Notepad++ while I had a huge file open from a network share, and it rendered Notepad++ unresponsive for a long time when I tried to start it again. I killed the task and then removed the problematic `` element from _session.xml_ before trying again, and that fixed the problem. Thanks! – Troy Gizzi Dec 01 '17 at 20:52
  • 3
    @TroyGizzi Glad it helped :) – Shrout1 Jan 16 '18 at 21:33
  • 1
    This was the answer I was after. No point trying to open Notepad++ if it doesn't even start! – Fandango68 Sep 18 '19 at 23:16
  • 1
    @Fandango68 Happy it helped you out! – Shrout1 Sep 19 '19 at 15:22
17

Ok, I had a problem with Notepad++ not remembering that I had chosen not the "Remember Current Session". I tried hacking the config file, but that didn't work. Then I found out that there is a secret config file in your C:\Users\myuseraccount\AppData\Roaming\Notepad++ directory (Windows 7 x64). Mine was empty, meaning who know where the config was really coming from, but I copied over the file with the one in C:\Program Files (x86)\Notepad++ and now everything works just like you would expect it to.

Don Rolling
  • 2,162
  • 4
  • 29
  • 24
11

Go to: Settings > Preferences > Backup > and Uncheck Remember current session for next launch

In older versions (6.5-), this option is located on Settings > Preferences > MISC.

GolezTrol
  • 109,399
  • 12
  • 170
  • 196
3

Use the menu item Settings>Preferences.

On the MISC tab of the resulting dialog, uncheck "Remember current session for next launch."

Andy Thomas
  • 78,842
  • 10
  • 93
  • 142
0

I read the answers. Then I noticed for me that the check box was already unchecked, but it still always reloaded the files. This is the Settings->Preferences->MISC->"Remember current session for next launch" check box on version 6.3.2. The following got rid of the problem:

1. Check the check box.
2. Exit the program.
3. Start the program again.
4. Uncheck the checkbox.
user2367418
  • 186
  • 5