[IPython-user] Beginner questions (mostly about history)

Gerhard Fiedler gelists@gmail....
Wed Jun 6 12:25:08 CDT 2007

On 2007-06-06 12:59:38, Ville M. Vainio wrote:

>> I'm just starting to use IPython; I want to see how it works out as my
>> main shell. (This is on WinXP.)
> Cool. First of all, remember to launch IPython by "ipython -p sh" (or
> use the 'pysh' start menu shortcut) to enjoy all the shell benefits
> (they end up in 'sh' profile first).

Yes... that much I already figured out :)

>> - I see that the command history is persistent between sessions, as I
>> can recall past commands through the up arrow, even from past sessions.
>> But I can't figure out how to list them; when I use %hist, I only get
>> the commands from this session. Is there a way to list the commands
>> from previous sessions also?
> The up arrow gives you stuff from readline history, which don't end up
> in the input history structure of IPython proper (they also don't have
> an input history index number).

Ok... sounds like I have to read up on readline then.

> I have thought of a feature called "shadow history" that would have
> every command ever executed, but only once. I'm not yet sure how to
> refer to those history entries, Perhaps by octal-looking notation:
> %rep 24
> # fetch line 24
> %rep 024
> # fetch line 24 in shadow history

I'd like such a "shadow history". Maybe use a different command, since it
is in essence a different list anyway. A configurable max number of entries
would probably be a good thing, and a way to list the commands (possibly by
last used date and alphabetically) would be helpful. 

>> - The directory history doesn't seem to be persistent between sessions,
>> but I'd like it to be. Can this be done?
> It can be done. I'll add it to the 'sh' profile.

Thanks. How do I know when you did it and how do I get the change?

> %bookmark may also be handy for this, see '%bookmark?'.

Yes, I've seen this. The directories I'll go to often will end up as
bookmarks probably, but such a persistent directory history is a bit
different as it shows not necessarily where I go often but where I went

> You don't have to "type the remainder to get something unique", just
> enter one letter and press tab again to expand as much as can be
> expanded unambiguously...

Ah, makes sense; I might have confused some things when experimenting with
it. I'll try it a while before I complain again :)

Thanks a lot for your help,

More information about the IPython-user mailing list