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

Problem with "cursor position requests" #48

Open
jlesieutre opened this issue Jan 10, 2020 · 9 comments
Open

Problem with "cursor position requests" #48

jlesieutre opened this issue Jan 10, 2020 · 9 comments

Comments

@jlesieutre
Copy link

jlesieutre commented Jan 10, 2020

Since the update to Sagemath 9.0, I am no longer able to use sage-shell-mode. After starting Sage in a buffer, when I send text via C-c C-r, it gives the warning WARNING: your terminal doesn't support cursor position requests (CPR). This happens no matter what terminal software I use: urxvt, xterm, gnome-terminal, or just the emacs gui.

When I run quit in the sage buffer (sage itself runs normally), it closes and then shows some messages that I haven't seen before:

Exiting Sage (CPU time 0m0.44s, Wall time 1m15.01s).
Task was destroyed but it is pending!
task: <Task pending name='Task-251' coro=<Renderer.wait_for_cpr_responses.<locals>.wait_for_responses() running at /usr/lib/python3.8/site-packages/prompt_toolkit/renderer.py:502> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f9f22618a60>()]>>           
Task was destroyed but it is pending!
task: <Task pending name='Task-384' coro=<Renderer.wait_for_cpr_responses.<locals>.wait_for_responses() running at /usr/lib/python3.8/site-packages/prompt_toolkit/renderer.py:502> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f9f226e88e0>()]>>  

Process Sage finished

I am using Sage, emacs, ... as distributed by Arch Linux. The problem persists even when I start without a .emacs file:

  • sagemath 9.0 (2020-01-10 release)
  • GNU emacs 26.3
  • sage-shell-mode-20191103.1040 installed via ELPA
@vale981
Copy link

vale981 commented Feb 21, 2020

same for me
Sage uses an Ipython shell now.
That doesn't seem to play nicely with emacs.

@jlesieutre
Copy link
Author

jlesieutre commented Feb 21, 2020

I have been able to run sage-shell-mode with sagemath 9.0 using the official binary under Ubuntu 18.04 (in a virtual machine) This is with the same .emacs and sage-shell-mode installed from MELPA either way. The main difference I see is that on Ubuntu I'm running emacs 25.2.2, whereas on Arch it's emacs 26.3. I don't know what other differences there might be between the default configurations.

@Sakul7
Copy link

Sakul7 commented May 20, 2020

I've been having a similar problem with Manjaro and sagemath 9.0. I also get the warning WARNING: your terminal doesn't support cursor position requests (CPR). , but for me sage doesn't work normally. The cursor is not where it's supposed to be, outputs are duplicated, and loading files with C-c C-c just gives an output of Text is read-only in the emacs mini-buffer.
I tried to narrow it down and it seems to work fine with Debian (in a virtual machine) for emacs 26.1. I also tried a bunch of different Manjaro configurations as a VM, e.g., with gnome desktop or bash (instead of zsh) as the standard terminal, but the error persistently occurred on all of them. Do you have a solution or any leads? Does everything work normally under Arch (might consider switching)?

@jlesieutre
Copy link
Author

jlesieutre commented May 20, 2020

No, it's still broken in Arch. I have no solution except to use it in a Debian VM.

On a recent StackExchange thread someone suggested it may be related to this issue. The solution on StackExchange didn't work for me, but you could try it.

@Sakul7
Copy link

Sakul7 commented May 21, 2020

Thanks for the quick response!
I also saw that thread but couldn't get it to work. Did you try building sage from source? I was wondering if it is still related to issue #7. I tried myself following the instructions and the comment by @stakemori, but couldn't get the build to work on my system (I get an error while building ecl).

@jlesieutre
Copy link
Author

jlesieutre commented May 22, 2020

I didn't build from source, no -- I have never had much luck with this on Arch since there are always some dependencies in the AUR that don't have compatible versions.

@Sakul7
Copy link

Sakul7 commented Jun 9, 2020

In case anyone is interested, after building sage from source, sage-mode finally works for me again! I suppose the problem was the incompatibility with iPython 5 (see #7) after all. The build worked on Manjaro after following the instructions for Arch in the official installation guide.

@jlesieutre
Copy link
Author

jlesieutre commented Dec 3, 2020

In case anyone stumbles still upon this, it is the same issue as #53, caused by an iPython update. EmmanuelCharpentier gives the solution of starting Sage with "sage --simple-prompt", which works for now, and it sounds like it should run this way by default in the future.

@EmmanuelCharpentier
Copy link
Collaborator

This is issue #53 for which a PR has been proposed on Aug 25, still unreviewed on Dec 25.... In the interim, feel free t use my fork.

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

4 participants