Determining "useless" items in History

You have encountered a problem using Far Manager? Here you can get help.
Post Reply
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Determining "useless" items in History

Post by pepak »

I suspect this might be more of a "Suggestions and Ideas" question, but perhaps it has already been implemented.

Looking at my stored history over the years, it seems that I have a lot of garbage data that isn't really useful except for a very limited time. For example, if I press ENTER on a file in panels, the file is considered executed and will get stored in the history forever - but I only really need it for a short time, just to see that I did execute that file in ALT+F8. But after say a day or so, that file can be safely discarded. On the other hand, if I type a command on the command line and execute it, chances are I would like to type that same command later on, so it should be kept in history indefinitely. Unfortunately, I can't figure a way of distinguishing case #1 (file executed from the panels) from case #2 (command executed from the command line). Is there any solution?

If not, there's a field "type" in the history.db's history table which would seem to cover the source quite well. Currently, it only seems to be used in View/Edit history (kind=2), so presumably I could modify FAR to store a different value here based on the source of the command. Would that be feasible?

To a degree, the distinguishing mechanism could also use the number of times a command has been executed: If a command has only been used once, it can be deleted, otherwise it should be kept. Unfortunately, this also doesn't seem to be stored in history.db. What would happen if I added such a field to history.db?
2useven10
Posts: 5210
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 310 times

Determining "useless" items in History

Post by 2useven10 »

pepak, far:config System.ExcludeCmdHistory
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Determining "useless" items in History

Post by pepak »

I think that does the opposite of what I want - it won't add command line history at all. I want to keep both command line history and panels execution history, but I want to be able to summarily delete the panels history at certain intervals (e.g. every night). I can do the timed deletion already, but I can't recognize the source of the history :-(.

Added a bit later after looking at the source code in more detail: Or does it? The flags seem to indicate that it might, even though it seems it prevents the history altogether, which would also not be what I want (I want to keep the panel execution history for a little while, but not indefinitely).
Last edited by pepak on Sun 03 Nov, 2019 09:36, edited 2 times in total.
Shmuel
Posts: 6820
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 528 times

Determining "useless" items in History

Post by Shmuel »

pepak, in far:config, position cursor on System.ExcludeCmdHistory and press ShiftF1.
Post Reply

Return to “Support and Troubleshooting”