Re: [IPython 5] [Docs] Custom Terminal Prompts
Thomas Kluyver <[email protected]> Wed, 13 Jul 2016 11:38:10 +0100
| Newsgroups | gmane.comp.python.ipython.devel |
|---|---|
| Message-ID | <CAOvn4qi5mPWL1UgN5R=0OKnyjmft4xqtnmi1PT0axgysgV=pWg@mail.gmail.com> |
Thanks Carl! On 13 July 2016 at 01:34, Carl Smith <[email protected]> wrote: > The commit that adds the examples: > > https://github.com/ipython/ipython/commit/95ed0855ae23e55c10b46903db911265aa1cdd58#diff-c5d5abe11d1c298906cb121c45eb12e2 > Sigh, of course we have docs on customising prompts in two places. I'll try to unify them... > One thing I found buggy was the rewrite prompt. If you inherit from > `Prompt` and redefine some of the prompt methods in the derived class, as > you're meant to do, any prompts that you inherit from `Prompt` will pad > themselves out to keep everything aligned. This works well except when you > have a multiline prompt. > Yes, I think the prompt is conceptually a single line. Does the information in the lines above where you type need to change while you're typing? If not, I'd recommend printing it before the prompt is displayed with the post_run_cell event ( http://ipython.readthedocs.io/en/stable/config/callbacks.html). Thomas _______________________________________________ IPython-dev mailing list [email protected] https://mail.scipy.org/mailman/listinfo/ipython-dev