I was interested myself too so had a quick search. There are a couple of implementations of the idea out there, <a href="https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;advanced-shell-history&#x2F;" rel="nofollow">https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;advanced-shell-history&#x2F;</a> looks the most promising of the ones I looked at. I might have to play with it later.