-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add '--simple-prompt' argument for sage #25363
Comments
Attachment: 0001-Add-new-option-for-ipython-simple-prompt.patch.gz Format patch |
This comment has been minimized.
This comment has been minimized.
Branch: public/25363 |
Commit: |
comment:2
I have made a proper git branch. New commits:
|
Author: Frédéric Chapoton |
Changed keywords from ipython to Cantor, ipython |
comment:3
It would be nice to fix the Sage backend for Cantor! |
This comment has been minimized.
This comment has been minimized.
Changed author from Frédéric Chapoton to Nikita Sirgienko, Frédéric Chapoton |
comment:5
review, somebody ? |
comment:6
|
comment:8
oops, fixed |
comment:9
This seems fine in principle, though, I would call it just Now, as for this change, other than the single hyphen thing this is fine since it's consistent with what's already done. But I hadn't looked at this bit of code before and I find it rather suspicious in the first place. I don't like that there's some hard-coded list of arguments that happen to be arguments recognized as belonging to IPython in order to determine that the user is trying to invoke an interactive prompt, because as you've pointed out here it does not scale--it's just an arbitrary subset of IPython arguments, and does not inherit new IPython arguments or additional ones that one might want to use. Let me take a closer look at this problem and think about it a bit... |
comment:10
The |
comment:11
In fact, with the exception of
|
comment:12
How does the Sage backend in Cantor work? Is it like, pexpect-based or something? I would suggest that it not be. Sage is, ultimately, a Python library, so there's no need to use it through Sage's interactive prompt, in order to pass input and receive output. That said, I have no idea how Cantor's backends work in general. |
Changed branch from public/25363 to u/embray/ticket-25363 |
comment:13
This preserves the existing (still rather kludgy) CLI semantics, while not hard-coding a limited subset of IPython CLI options. This means you can also pass New commits:
|
comment:26
update milestone 8.3 -> 8.4 |
comment:28
I looked at the old commits, and I am concerned that they are too ambitious: they would pass any unrecognized command-line flag to ipython. Here is a more modest proposal: diff --git a/src/bin/sage b/src/bin/sage
index ce325f5d03..bc192ab6e5 100755
--- a/src/bin/sage
+++ b/src/bin/sage
@@ -1045,7 +1045,7 @@ if [ "$1" = '-omega' -o "$1" = "--omega" ]; then
exec sage-omega "$@"
fi
-if [ "$1" = '-gthread' -o "$1" = '-qthread' -o "$1" = '-q4thread' -o "$1" = '-wthread' -o "$1" = '-pylab' ]; then
+if [ "$1" = '-gthread' -o "$1" = '-qthread' -o "$1" = '-q4thread' -o "$1" = '-wthread' -o "$1" = '-pylab' -o "$1" = '--simple-prompt' -o "$1" = '-simple-prompt' ]; then
# Intentionally no "shift" here
interactive_sage "$@"
fi (The new option should also be listed in the help message.) |
Changed branch from u/embray/ticket-25363 to u/jhpalmieri/ticket-25363 |
Changed author from Erik Bray to John Palmieri |
comment:30
Here is an actual branch. The more ambitious changes can happen on another ticket, but we should get this done quickly to fix the emacs problem. (Any problem with emacs has a critical priority, at least.) New commits:
|
comment:31
Thank you, John. Now, the question is to adopt your patch or to use it as a stopgap until more ambitious (and more reasoned) changes to Sage-s arguments implement long-awaited features can be (carefully) validated... |
comment:32
Replying to @jhpalmieri:
Seconded. With extreme energy... |
comment:33
Replying to @jhpalmieri:
OK. It does what the label says : the Stay tuned. |
comment:34
Replying to @EmmanuelCharpentier:
See also #21. |
This comment has been minimized.
This comment has been minimized.
comment:36
Replying to @jhpalmieri:
Both typesetting and plots work (tested in simple cases...). I'm currently scratching my head to figure how to patch |
comment:37
Replying to @EmmanuelCharpentier:
However, Back to the old drawing board... |
comment:38
Emacs does not hang for me after running
This also worked after I turned off my |
comment:39
Replying to @EmmanuelCharpentier: [ ... ]
I was a tad pessimistic : |
comment:40
This passes ==> |
Changed branch from u/jhpalmieri/ticket-25363 to |
IPython accepts a
--simple-prompt
argument, changing the input handler fromprompt_toolkit
toraw_input
.It would be very useful if Sage could pass this argument to IPython,
as it does with
-gthread
,-qthread
,-q4thread
,-wthread
and-pylab
,because in Cantor, a front-end program for mathematical packages,
the Sage backend is now broken and that would fix it.
CC: @slel @embray @jdemeyer @EmmanuelCharpentier @dimpase
Component: scripts
Keywords: Cantor, ipython
Author: John Palmieri
Branch/Commit:
3b8b2bd
Reviewer: Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/25363
The text was updated successfully, but these errors were encountered: