Skip to content
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

Sage 9.2.beta8 breaks sage-shell-mode #53

Closed
EmmanuelCharpentier opened this issue Aug 11, 2020 · 5 comments
Closed

Sage 9.2.beta8 breaks sage-shell-mode #53

EmmanuelCharpentier opened this issue Aug 11, 2020 · 5 comments

Comments

@EmmanuelCharpentier
Copy link
Collaborator

EmmanuelCharpentier commented Aug 11, 2020

Copy of this sage-release post :

Damn !

This release breaks sage-shell-mode support for a sage session into emacs. After starting an emacs session, I get the normal banner and a normal prompt. A little while after that (about 0.5 to 1 second), a warning WARNING: your terminal doesn't support cursor position requests (CPR). appears immediately below the banner and above the prompt, then the cursor goes right to the right margin (i. e. in the right scrollbar).

I still can type Sage code, which appears at the left margin on the line immediately below the prompt. Typing <Return> displays a continuation prompt (.....:) 7 spaces,, then my code,which gets executed and the answer printed on the line below the continuation prompt. Example :

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.2.beta8, Release Date: 2020-08-10               │
│ Using Python 3.7.3. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
WARNING: your terminal doesn't support cursor position requests (CPR).
sage: sage:                                                                      
....:       1+1                                                                  
2
sage:

No error message appears in the terminal window from which I launched emacs ; nothing unusual in the Messages buffer either.

I’m stymied…

@mkoeppe
Copy link
Member

mkoeppe commented Aug 11, 2020

For context, 9.2.beta8 did the overdue update from ipython 5 to ipython 7

@EmmanuelCharpentier
Copy link
Collaborator Author

An emergency patch, currently positively reviewed, adds the option --simple-prompt to the options accepted by sage (for which oine is prompted for when starting sage by M-x run-sage). Adding this option to the command-line used by sage-shell-mode to start sage is enough to restore a normal function of Sage insage-shell-mode.

It is also enough to run successfully ob-sagemath (the org-mode interface to sage), provided that a sage session has already been started by M-x run-sage with passing this --simple-prompt option. If this is not the case, the first call to sage from ob-sagemath will hang emacs. Caveat emptor...

Work is underway to find a way to automate this option passing while accounting for the current version of Sage :

  • <=9.2.beta7 : do not use --simple-prompt (the option is not accepted).
  • 9.2.beta8 : lost cause...
  • >9.2.beta8 : use --simple-prompt.

Help from someone more familiar than I am with sage-shell-mode code is welcome...

@EmmanuelCharpentier
Copy link
Collaborator Author

I forgot to post here that I submitted, about 3 weeks ago, a PR from my fork, which fixes the present issue ; reviewers welcome...

@EmmanuelCharpentier
Copy link
Collaborator Author

EmmanuelCharpentier commented Dec 25, 2020

This pull requests has been proposed on Aug 25, 2020. And has been sleeping until today (Dec 25, 2020)...

A review might be in order...

@dimpase
Copy link
Member

dimpase commented Dec 25, 2020

should be closed by #54

@dimpase dimpase closed this as completed Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants