[IPython-User] Shadow history

Jorge Scandaliaris jorgesmbox-ml@yahoo...
Thu Jan 27 12:41:38 CST 2011

Jorge Scandaliaris <jorgesmbox-ml <at> yahoo.es> writes:

> Ville M. Vainio <vivainio <at> gmail.com> writes:
> > Try running "%clear shist_compress" while running with the old shadow
> > history. This consolidates all entries to one entry, in file
> > .ipython/db/shadowhist. Then copy over the file to the new ipython
> > shadow history instance.
> > 
> Well, I tried to follow your advice, but shadow history doesn't seem to work at
> all in the current trunk...

There seems to be a simple typo in history.py (diff at bottom of the post), but
also the magic command %clear doesn't exist anymore? Was it renamed to something


diff --git a/IPython/core/history.py b/IPython/core/history.py
index ba13aa5..d56a5ac 100644
--- a/IPython/core/history.py
+++ b/IPython/core/history.py
@@ -409,7 +409,7 @@ def magic_history(self, parameter_s = ''):
     found = False
     if pattern is not None:
-        sh = self.shell.history_manager.shadowhist.all()
+        sh = self.shell.history_manager.shadow_hist.all()
         for idx, s in sh:
             if fnmatch.fnmatch(s, pattern):
                 print("0%d: %s" %(idx, s.expandtabs(4)), file=outfile)

More information about the IPython-User mailing list