prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Integrate IPython with prompt toolkit issue
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to embed IPython into my app using prompt toolkit.
I'd like to put IPython shell bottom of HSplit Container.
Here's an example app layout.
--------------------------------------------------
(TextArea, multiline, scroll)
Log1
Log2
Log3
--------------------------------------------------
(IPython Shell, multiline, scroll)
In [1] : 1 + 1
Out [1] : 2
--------------------------------------------------
But I have hard time to do it.
First, IPython uses prompt.
It calls Application.run() internally and uses its own layout. So it is difficult to use it with my prompt toolkit application.
Second IPython calls prompt repeatedly.
I manipulated shell.pt_app.layout.container. So the layout could be changed. But after typing enter key, the whole layout was drawn again. The reason is that prompt redraws whole containers and is always called after completing input.
Could you advise for it?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the prompt toolkit Application.run() flow and the repeated prompt calls described in the issue, including changes to shell.pt_app.layout.container. Determine how the IPython shell can remain at the bottom of the HSplit layout without replacing the surrounding containers after Enter; done means the example layout preserves its log area and embedded shell across input redraws.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100