Re: Using Prompt Toolkit to edit terminal inputs in a screen editor.
Carl Smith <[email protected]> Tue, 19 Jul 2016 17:58:54 +0100
| Newsgroups | gmane.comp.python.ipython.devel |
|---|---|
| Message-ID | <CAP-uhDc=w81c5rbeRcBgoQzfwRHJG-e-gC5B4Dx7Or3CJi2kGQ@mail.gmail.com> |
Sorry for sending a blank reply to the list earlier. GMail needs to move [Send] to the right-hand side. On 19 July 2016 at 12:10, Thomas Kluyver <[email protected]> wrote: > Ooh, nice find. If we can agree on a keyboard shortcut that people like >> for this, I'd like to enable it by default in IPython. >> > Sweet. That would cool. Cheers Thomas. I found it a couple of days ago, and use it all the time. Prompt Toolkit is awesome. Once you get a reference to their PT cli instance (as `ip.pt_cli`, or the first arg to any prompt token method, or the `cli` attribute of any event) you can access the input buffer, set up keybindings and any stuff like that - basically, anywhere you're just playing with state and event handlers, you're generally ok. But. There are still a lot of cool options that are in the PT docs, that we can't access yet from IPython (as far as I tell). The documented APIs for the inaccessible PT features involve passing stuff to their `parse` method, using named args, but there's no obvious way to attach the same stuff to a running instance. Any ideas would be appreciated. As a concrete example, how would an IPython user add a bottom toolbar: http://python-prompt-toolkit.readthedocs.io/en/stable/pages/building_prompts.html#adding-a-bottom-toolbar Thanks, -- Carl Smith [email protected] _______________________________________________ IPython-dev mailing list [email protected] https://mail.scipy.org/mailman/listinfo/ipython-dev