Menu

#112 Drop repeated occurences of the same command in rawhistory view

open
nobody
2015-01-04
2015-01-04
Anonymous
No

Originally created by: tbabej
Originally owned by: dvorka

I am using rawhistory view + keyword search, because I want to make sure most recent commands are on top (I am so used to this behaviour, I do not even think about it.)

It is really not useful, if multiple occurences of the same command appear in the view. It can look as follows:

tbabej@thinkpad$ python 
Type to filter, UP/DOWN move, DEL remove, TAB select, C-f add favorite, C-g cancel
- HISTORY - view:history (C-/) - match:keywords (C-e) - case:insensitive (C-t) - 18738/61621/0 -----------------------------------
 python
 python
 python setup.py test
 python setup.py test
 python setup.py test
 python setup.py test
 python setup.py test
 python setup.py test
 python setup.py test
 python setup.py tests
 python setup.py test
 python setup.py test
 python setup.py test
 python setup.py test
 python setup.py test
 sudo python setup.py install --force
 python
 python setup.py test
 python
 python
 python setup.py test
 python
 sudo python setup.py install --force
 sudo python setup.py install --force
 python setup.py test
 python setup.py test
 sudo python setup.py install --force
 sudo python setup.py install --force

We should filter these non-unique occurences out, keeping only the most recent occurence (so that the results are sorted by how recently they were used).

Then, the output above would become:

tbabej@thinkpad$ python 
Type to filter, UP/DOWN move, DEL remove, TAB select, C-f add favorite, C-g cancel
- HISTORY - view:history (C-/) - match:keywords (C-e) - case:insensitive (C-t) - 18738/61621/0 -----------------------------------
 python
 python setup.py test
 python setup.py tests
 sudo python setup.py install --force
... lots of maybe useful commands that can appear on the screen now

Discussion

  • Anonymous

    Anonymous - 2015-01-04

    Originally posted by: dvorka

    Makes sense - I will make what you suggested the default + there will be option to keep duplicates to get "true raw" view of history (as it might be useful in certain cases).

    (hstr_history.c:106 w/ option duplicates keep only latest occurrence)

     

Log in to post a comment.