Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#14687 closed defect (fixed)

Extra readline commands not working

Reported by: klee Owned by: was
Priority: minor Milestone: sage-5.11
Component: user interface Keywords:
Cc: dimpase Merged in: sage-5.11.beta1
Authors: Kwankyu Lee Reviewers: Dmitrii Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by dimpase)

After #12719, the extra readline commands do not work in Sage even though the IPython configuration file is updated according to a new format.

Apply to the scripts:

Apply (to the sage library):

Attachments (2)

trac_14687-scripts.patch (690 bytes) - added by klee 8 years ago.
To scripts repository
trac_14687.patch (4.2 KB) - added by klee 8 years ago.
To sage library

Download all attachments as: .zip

Change History (18)

Changed 8 years ago by klee

To scripts repository

comment:1 Changed 8 years ago by klee

  • Authors set to Kwankyu Lee
  • Description modified (diff)
  • Type changed from PLEASE CHANGE to defect

comment:2 Changed 8 years ago by klee

  • Description modified (diff)

comment:3 Changed 8 years ago by klee

  • Status changed from new to needs_review

comment:4 Changed 8 years ago by dimpase

  • Cc dimpase added

comment:5 follow-up: Changed 8 years ago by dimpase

I am trying to follow the instructions on #12503 (as I removed my ~/.sage/ at some point lately), but it does not seem to work (using Sage 5.9 on OSX 10.6.8).

Hitting control-o results in cursor moving forward in the line few spaces, similar to TAB. (after I do stty discard undef before starting Sage).

history-search-forward-and-save does not work at all.

Same with Sage 5.10.rc0 on Linux.

Last edited 8 years ago by dimpase (previous) (diff)

comment:6 in reply to: ↑ 5 Changed 8 years ago by dimpase

Replying to dimpase:

I am trying to follow the instructions on #12503 (as I removed my ~/.sage/ at some point lately), but it does not seem to work (using Sage 5.9 on OSX 10.6.8).

Hitting control-o results in cursor moving forward in the line few spaces, similar to TAB. (after I do stty discard undef before starting Sage).

history-search-forward-and-save does not work at all.

Oops, I am stupid. Now I see that the instructions on enabling this have changed!

Will report shortly.

comment:7 Changed 8 years ago by dimpase

Please be more specific in your patch about ipython_config.py? Currently you just say

IPython configuration file  ``ipython_config.py``

Is it still supposed to be in $DOT_SAGE/ipython/ ?

I do not have a file so named there. On OSX 10.6.8 system the only .py files are

$ ls -l ~/.sage/ipython/*.py
-rw-r--r--  1 dima  staff  2361 Nov 24  2012 /Users/dima/.sage/ipython/ipy_profile_sh.py
-rw-r--r--  1 dima  staff   836 Nov 24  2012 /Users/dima/.sage/ipython/ipy_user_conf.py

And a very similar picture on Linux.

comment:8 Changed 8 years ago by dimpase

  • Status changed from needs_review to needs_work

comment:9 follow-up: Changed 8 years ago by klee

The specific location for the IPython configuration file is

.sage/ipython-0.12/profile_sage/ipython_config.py

and you need to create the configuration file if it is absent.

I was reluctant to be this specific about the location since it seems to me that the directory name "ipython-0.12" is doomed to change someday, and the exact location, I think, should be documented elsewhere.

comment:10 in reply to: ↑ 9 ; follow-up: Changed 8 years ago by dimpase

Replying to klee:

The specific location for the IPython configuration file is

.sage/ipython-0.12/profile_sage/ipython_config.py

and you need to create the configuration file if it is absent.

I was reluctant to be this specific about the location since it seems to me that the directory name "ipython-0.12" is doomed to change someday, and the exact location, I think, should be documented elsewhere.

Well, replace lines 26-27 of your patch of readline_extra_commands.pyx with the following.

 To bind these commands with keys, insert the relevant lines into the IPython config file 
 ``$DOT_SAGE/ipython-<version_number>/profile_sage/ipython_config.py``.  
Note that ``$DOT_SAGE`` is ``$HOME/.sage`` by default. At the time of this patch, 
in Sage 5.11, ``<version_number>`` is 0.12. For example, 

After this, I'll be happy to give it positive review (it actually works just fine).

Feel free to open a ticket on documenting the location of ipython_config.py properly.

comment:11 in reply to: ↑ 10 Changed 8 years ago by klee

Replying to dimpase:

Well, replace lines 26-27 of your patch of readline_extra_commands.pyx with the following.

 To bind these commands with keys, insert the relevant lines into the IPython config file 
 ``$DOT_SAGE/ipython-<version_number>/profile_sage/ipython_config.py``.  
Note that ``$DOT_SAGE`` is ``$HOME/.sage`` by default. At the time of this patch, 
in Sage 5.11, ``<version_number>`` is 0.12. For example, 

The directory name is fixed as "ipython-12". On a discussion about the name, "ipython-12-or-later" was suggested, but the final name was settled to as it is now. My opinion is that the name was ill-chosen, as it confuses users, at least you and me. :-) Anyway, currently it is officially "ipython-12".

So I will update the patch just now accepting the official location.

Version 0, edited 8 years ago by klee (next)

comment:12 Changed 8 years ago by klee

  • Status changed from needs_work to needs_review

Changed 8 years ago by klee

To sage library

comment:13 Changed 8 years ago by dimpase

  • Description modified (diff)
  • Status changed from needs_review to positive_review

comment:14 Changed 8 years ago by jdemeyer

  • Reviewers set to Dmitrii Pasechnik

comment:15 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.11.beta1
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:16 Changed 8 years ago by dimpase

it looks as if ipython_config.py is removed each time Sage is updated. This is not good. There should be some other location for persistent settings like this one...

Note: See TracTickets for help on using tickets.