sage-shell-mode
sage-shell-mode copied to clipboard
Sage-shell:restart-sage messing with the window configuration after running pdb
Hi,
As written in the title, sage-shell:restart-sage is messing up my window configuration. Sometimes it's as simple as bringing up a code buffer, sometimes it completely moves my windows around... In most cases simply calling winner-undo is enough to return to my window configuration, but as the session goes longer the modifications get more complex and even sometimes appear to not be undoable.
I believe that it is linked to the pdb-tracking feature. Namely, it seems that the feature to kill the buffers when exiting pdb does not run when I exit pdb with C-d or with q.
But it's only part of the problem: it may happen that one wants the source code buffers to stay live after exiting the debugger (for instance if they were already live to begin with, which I believe the tracker takes care of), but still that the window configuration does not change when restarting sage.
Steps to reproduce the problem (tested with a vanilla emacs with only sage-shell-mode installed: ./emacs-sandbox.sh -O -i sage-shell-mode (https://github.com/alphapapa/emacs-sandbox.sh))
M-x sage-shell:run-sage- In the buffer, enter:
import pdb
1/0
pdb.pm()
u 3
3. This opens a buffer visiting interactiveshell.py. At that point, inspecting sage-shell-pdb:buffers-to-kill shows that interactiveshell.py is in the list
4. Exit pdb (either with q or C-d)
5. The buffer is not killed.
6. Change the buffer displayed in the window where interactiveshell.py is.
7. Move the point back to the sage-shell buffer, and M-x sage-shell:restart-sage
8. The window configuration is changed to display interactiveshell.py again.
Thanks!