readline weirdness in octave

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

readline weirdness in octave

Octave - General mailing list
Readline in Octave (on Linux at least) is a little different than
readline functionality for everything else, in that it seems to be doing
a search on up- and down-arrows. If I type a partial command at, say, a
bash prompt, and then hit up-arrow, it just switches to the previous
command. In Octave, it searches to a previous command starting with what
I typed so far---which is great for the nimble-fingered, but doesn't
work that well for the fat-fingered rest of us: for example, I often try
to hit an up-arrow on an empty line, miss it so that  I get some garbage
chars like ~, and then the up-arrow doesn't work until I manually delete
those extra chars.

Similarly, after mistyping a command, and up-arrowing it to make
corrections,  typing anything, including left- and right-arrows, locks
readline into search mode: for instance

bad1

bad2

and typing up-arrow returns bad2 and then bad1, but if you type a
left-arrow first followed by right-arrow, up-arrow no longer works,
probably because it searches for bad2.

This behavior is hard to describe because there's no feedback as to what
is it searching for and when---which is why I would rather turn it off
if possible---Is there a way to do it?



Reply | Threaded
Open this post in threaded view
|

Re: readline weirdness in octave

siko1056
On 8/13/20 1:58 AM, Przemek Klosowski via Help-octave wrote:

> Readline in Octave (on Linux at least) is a little different than
> readline functionality for everything else, in that it seems to be doing
> a search on up- and down-arrows. If I type a partial command at, say, a
> bash prompt, and then hit up-arrow, it just switches to the previous
> command. In Octave, it searches to a previous command starting with what
> I typed so far---which is great for the nimble-fingered, but doesn't
> work that well for the fat-fingered rest of us: for example, I often try
> to hit an up-arrow on an empty line, miss it so that  I get some garbage
> chars like ~, and then the up-arrow doesn't work until I manually delete
> those extra chars.
>
> Similarly, after mistyping a command, and up-arrowing it to make
> corrections,  typing anything, including left- and right-arrows, locks
> readline into search mode: for instance
>
> bad1
>
> bad2
>
> and typing up-arrow returns bad2 and then bad1, but if you type a
> left-arrow first followed by right-arrow, up-arrow no longer works,
> probably because it searches for bad2.
>
> This behavior is hard to describe because there's no feedback as to what
> is it searching for and when---which is why I would rather turn it off
> if possible---Is there a way to do it?
>

My only usages of readline are the up-arrow and CTRL+R (search) feature.
 I cannot confirm that behavior for the left- and right-arrow, or maybe
I did not try hard enough?!  I use the default /etc/inputrc from
OpenSUSE 15.2, without modifications in a local ~/.inputrc file.

Anyways, usually you can escape the search mode pressing ESC.  If you
need more modification, maybe [1,2] are useful pointers.

HTH,
Kai

[1] https://octave.org/doc/v5.2.0/Customizing-readline.html
[2] https://tiswww.cwru.edu/php/chet/readline/readline.html#SEC9