readline? problem

3 views
Skip to first unread message

John H Palmieri

unread,
Aug 6, 2009, 2:40:10 PM8/6/09
to sage-support
I have a problem with Sage and maybe readline on an ubuntu box. If I
type

sage: squ<TAB>

then it partially completes to

sage: squarefree_

Then it lists the options ("squarefree_divisors squarefree_part") and
puts the cursor in the wrong place: the cursor ends up on the "s" in
"squarefree_". If I then type "d" then TAB, it completes "divisors"
and leaves the cursor at the end of that word. This seems to only
happen when there are several possible completions: if I type
"squarefree_d<TAB>", it completes and leaves the cursor in the right
place.

Has anyone seen this before? Is some terminal setting messed up? The
same thing happens whether I run xterm or the default gnome-terminal.
On the other hand, if I remote log in to the machine, then I don't see
this: the cursor ends up where it is supposed to when I TAB complete
things. (For example, I'm sitting at this ubuntu box right now. I
can ssh to another machine, and then from there ssh back to this one,
and I don't see the tab problem. This doesn't seem like the ideal
solution, however.)

John

John H Palmieri

unread,
Aug 6, 2009, 5:50:13 PM8/6/09
to sage-support
On Aug 6, 11:40 am, John H Palmieri <jhpalmier...@gmail.com> wrote:
> I have a problem with Sage and maybe readline on an ubuntu box.  If I
> type
>
>   sage: squ<TAB>
>
> then it partially completes to
>
>   sage: squarefree_
>
> Then it lists the options ("squarefree_divisors  squarefree_part") and
> puts the cursor in the wrong place: the cursor ends up on the "s" in
> "squarefree_".  If I then type "d" then TAB, it completes "divisors"
> and leaves the cursor at the end of that word.  This seems to only
> happen when there are several possible completions: if I type
> "squarefree_d<TAB>", it completes and leaves the cursor in the right
> place.

By the way, I should say: this is not a new problem. I've been seeing
this for several versions of Sage -- I forget when it first started.

John
Message has been deleted

John H Palmieri

unread,
Aug 7, 2009, 1:15:00 AM8/7/09
to sage-support
On Aug 6, 4:08 pm, Minh Nguyen <nguyenmi...@gmail.com> wrote:
> Hi John,
>
>
>
>
>
> On Fri, Aug 7, 2009 at 4:40 AM, John H Palmieri<jhpalmier...@gmail.com> wrote:
>
> > I have a problem with Sage and maybe readline on an ubuntu box.  If I
> > type
>
> >  sage: squ<TAB>
>
> > then it partially completes to
>
> >  sage: squarefree_

[snip]

> I have experienced a similar problem before on an Ubuntu box. Sage is
> bundled with readline 5.x so I thought that it couldn't be a problem
> with readline. However, there is a distinction between the readline
> library and the development library of readline, which is something
> like readline5-dev. So I used synaptic to also install the development
> library of readline 5.x. Then I compiled Sage again. The newly
> compiled Sage then doesn't have such problems any more.

Thanks, I'll try that. (I found something like libreadline5-dev and
installed it.)

John

Lars Fischer

unread,
Aug 7, 2009, 6:42:52 AM8/7/09
to sage-support
Hello John,

if a recompilation does not work (or take too long), you could try to
disable colors:
set
colors NoColor
instead of colors Linux
in
~/.sage/ipython/ipythonrc

Whenever I encountered this completion bug, disabling of colors made
it go away. Most of the time, the bug came with a precompiled binary
and vanished with a self-compiled version.


For the records: I am using Ubuntu. A libreadline-dev was probably
always present, because I was compiling pari/gp.

Lars
Reply all
Reply to author
Forward
0 new messages