Skip to content

Support multiline input in --simple-prompt - #10606

Merged
Carreau merged 3 commits into
ipython:masterfrom
infinity0:master
May 29, 2017
Merged

Support multiline input in --simple-prompt #10606
Carreau merged 3 commits into
ipython:masterfrom
infinity0:master

Conversation

@infinity0

@infinity0 infinity0 commented May 25, 2017

Copy link
Copy Markdown
Contributor

fixes: #9816

@infinity0

Copy link
Copy Markdown
Contributor Author

Actually, ideally I would take the prompt_text and prompt_continuation from the underlying application config - if I change them to sage: and ....: respectively, then the cantor sage backend does work with sage 7.6 / ipython 5.

This fixes the Cantor Sage backend
@infinity0

Copy link
Copy Markdown
Contributor Author

Some help fixing the tests would be appreciated, but at least my own cantor-sage-backend works now with this patch applied to IPython (plus a corresponding patch in sagemath to force simple_prompt when called by Cantor).

@Carreau Carreau changed the title Support multiline input in --simple-prompt (fixes: #9816) Support multiline input in --simple-prompt May 25, 2017
@Carreau

Carreau commented May 26, 2017

Copy link
Copy Markdown
Member

Have you tried to use rlipython ? This allow IPython to reuse readline as a frontend, and should and you will not need to wait for a new release of IPython.

@Carreau

Carreau commented May 26, 2017

Copy link
Copy Markdown
Member

So it seem you miss-committed, as the only missing thing was an import of cast_unicode_py2. Which is unnecessary as IPython 6 is Python 3 only, but that will make backport easier.

@Carreau Carreau added this to the 5.4 milestone May 26, 2017
@infinity0

Copy link
Copy Markdown
Contributor Author

Oh right, thanks! Yes I had been testing this against 5.1.0 from Debian, and didn't notice the import had been removed from git master.

I'll let the Sage developers know about rlipython. It would be good to have this patch in IPython as well though, so that multiline input works even if not using rlipython. And it's easier for me to backport stuff to Debian after it's been accepted upstream, rather than waiting for Sage to add a new feature.

@Carreau

Carreau commented May 29, 2017

Copy link
Copy Markdown
Member

ok, let's get that one in and backport.

@Carreau
Carreau merged commit 85ebbe6 into ipython:master May 29, 2017
@Carreau

Carreau commented May 29, 2017

Copy link
Copy Markdown
Member

@meeseeksdev backport

@lumberbot-app

lumberbot-app Bot commented May 29, 2017

Copy link
Copy Markdown
Contributor

Oops, something went wrong applying the patch... Please have a look at my logs.

@Carreau Carreau added the Still Needs Manual Backport Added My MrMeeseeks when a backport fails. Help by backporting it, solving conflicts, send PR. label May 29, 2017
Carreau added a commit to Carreau/ipython that referenced this pull request May 29, 2017
Merge pull request ipython#10606 from infinity0/master

Support multiline input in --simple-prompt
@Carreau Carreau added backported PR that have been backported by MrMeeseeks and removed Still Needs Manual Backport Added My MrMeeseeks when a backport fails. Help by backporting it, solving conflicts, send PR. labels May 29, 2017
Carreau added a commit that referenced this pull request May 29, 2017
@infinity0

Copy link
Copy Markdown
Contributor Author

Hm, unfortunately this breaks a lot of doctests in Sage. I'll investigate and try to fix...

@infinity0

Copy link
Copy Markdown
Contributor Author

That is because sage expects the prompt to be "In [0]" but I changed it with this commit... should be quite simple to fix.

@infinity0

Copy link
Copy Markdown
Contributor Author

OK, confirmed I can un-break the Sage doctests with a 1-line fix, there is no need to further patch IPython.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported PR that have been backported by MrMeeseeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add multiline coding in ipython 5 with --simple-prompt

2 participants