How to disable FindHistory and FileEditViewHistory? auto-clear at exit?
-
As far as I know out NP++ does NOT provide an option to disable FindHistroy and FileEditViewHistory.
The only way is to manually (!) edit config.xml and delete corresponding lines.
This is surprising and disappointing.
I would call it a privacy issue.Are there any reasons to not let users disable recent file/search pattern lists?
Or at least to let them reduce it to only 1 item via GUI Settings?Or clear this items automatically at exit?
-
The real answer is to lock your PC when you leave it?
-
@Claudia-Svenson in Settings > Preferences, there is a Recent Files History section that allows you to customize the number of files in your history, and it looks like 0 is a valid option:
-
@Claudia-Svenson as for the Find history: I don’t see any settings in the Preferences window for this, but if you look in your
config.xml
file, you will see aFindHistory
tag with severalnbMaxFindHistory...
entries. On my setup, they are all set to10
, and I have 10Find
/Replace
entries in that section. So, in addition to deleting theFind
/Replace
entries, changing thenbMaxFindHistory..
values to0
might prevent NP++ from keeping a history going forward. -
(edit as there was a cross post)
@Claudia-Svenson, @mathlete2 has answered you for both the file history part and then the search history part. I had posted what’s below not realizing that mathlete2 was also answering the second part. Hopefully between what the two of us wrote you will know your to fix your Notepad++.
While Notepad++ is running the history for search/replace seems to be unlimited. However, Notepad++ saves the last 10 things searched for when it exits along with what was searched for.
You can configure how many search terms get saved by editing your
config.xml
file.- Exit from Notepad++
- Using Microsoft Notepad or an editor other than Notepad++ edit Notepad++'s
config.xml
file. - Near the very top of the config.xml file you will see a line with:
<FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" ...>
Change the number 10 to 0 (zero). You will need to change this in four spots on that line.
<FindHistory nbMaxFindHistoryPath="0" nbMaxFindHistoryFilter="0" nbMaxFindHistoryFind="0" nbMaxFindHistoryReplace="0" ...>
- Save the config.xml file and restart Notepad++.
Notepad++ will now be in a mode where the search history still has an unlimited length while Notepad++ is running but when you exit Notepad++ then the search history is not saved.
Notepad++ loads the config.xml file when it’s started and writes it back out when you exit Notepad++. That’s why in step 2 above you needed to use an editor other than Notepad++ to make the changes to config.xml.
Your config.xml file is normally at
%AppData%\Notepad++\config.xml
. If it is not their then post your Notepad++? / debug info
menu results here and someone will help you find the config.xml file. -
@mkupper said in How to disable FindHistory and FileEditViewHistory? auto-clear at exit?:
Notepad++ loads the config.xml file when it’s started and writes it back out when you exit Notepad++. That’s why in step 2 above you needed to use an editor other than Notepad++ to make the changes to config.xml.
The Configuration Files documentation also suggests using a portable copy of NP++ to do the editing, but another way to work around the overwrites is to:
- Copy
config.xml
to another directory. - Edit the copy with your usual NP++ installation.
- Close the session.
- Rename the original file to back it up.
- Copy over the edited file.
- Copy
-
While the proposed solutions by @mathlete2 and @mkupper probably work, they seem like they would be rather limiting to the user. I mean, well, what happens when the user wants to use the history to e.g. reopen a closed file…or when the user wants to recall some complicated regex search that they conducted yesterday – this data obviously won’t be there.
It’s one thing to answer a question, but it might be a more helpful thing to direct a user to a better place overall. But I suppose we can’t do this because @Claudia-Svenson didn’t elaborate on the situation in place where others could possibly somehow see this data.
There are more privacy concerns with Notepad++ when used in situations such as @Claudia-Svenson 's. An example is “unsaved” text data being saved in the “Backup” folder – gasp, anyone with access to the PC could see this.
It’s all a bit irrelevant, though, as on an “unsecured” PC, a rogue user sitting down at someone’s unlocked PC could see all. I’m not saying this is the @Claudia-Svenson situation, but just what is that situation?
-
There is no reason to question the enquiry/use case from @Claudia-Svenson . Privacy is important and a good reason for the question. Even more, it is good and valid that people are thinking about privacy and asking such questions.
In general it is a similar reason why browsers have a private mode.
I think it is clear, that both, privacy and working without limitation, is not possible at the same time, but removing all kind of history is exactly what is asked for in this topic.
As an example, consider the following use case. Multiple users/workers have access to same work station at a production line. Someone needs to reconfigure a machine with some confidential data from a customer. Data maybe from an external storage, so nobody else has access without rights, and it gets unplugged afterwards. Open it with Notepad++, does some adaption/formatting/searching to the confidential data. Configure machine. Clear history after finishing work.
I didn’t know that it is even possible to disable find history, thank you @mathlete2 and @mkupper for pointing this out.
Thank you @Alan-Kilborn for addressing the backup topic here, too, and the possibility to disable this feature. This is definitly something @Claudia-Svenson should also have a look at.
-
@MarkusBodensee said:
There is no reason to question the enquiry/use case
I mildly disagree, for reasons already stated… but mainly the reason is “to give better help to a questioning user”. But, in the spirit of “just answer the question posed”, then OK, the earlier answers (besides mine!) were very reasonable.
use case: Multiple users/workers have access to same work station at a production line. Someone needs to reconfigure a machine with some confidential data from a customer
Hopefully this is something I.T. has considered. (Of course, @Claudia-Svenson could be I.T., who knows…)
Data maybe from an external storage, so nobody else has access without rights, and it gets unplugged afterwards.
In this scenario, I’d remove Notepad++ from the machine, and put portable Notepad++ on the “external storage” along with the data.
But, I normally resist speculation, i.e., using a crystal ball on a question in order to respond, so I’ve violated my own internal guideline on this one.