sagemath / sage-shell-mode

Emacs front end for SageMath
GNU General Public License v3.0
98 stars 16 forks source link

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

Closed EmmanuelCharpentier closed 3 years ago

EmmanuelCharpentier commented 3 years ago

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 commented 3 years ago

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

EmmanuelCharpentier commented 3 years ago

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 :

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

EmmanuelCharpentier commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

should be closed by #54