1

I used to recover in Octave the last command beginning with a certain string by typing it and then pressing the up arrow key (likewise for Matlab). This behavior is not reproduced in my current Octave's command prompt (the raw one, as executed from a terminal). Meaning, I type something, press up, and the very last command shows up, no matter if a previous one starting with that string is in the stack.

Any way of configuring Octave to reproduce such behavior? It's really useful.

UPDATE
1. Octave version 3.8.1
2. a way to implement it is to press Ctrl-r, and then type (not really the same effect, as it searches for a command containing -not starting with- that string.)

nightcod3r
  • 752
  • 1
  • 7
  • 26
  • What version of octave? – Daniel Oct 26 '15 at 22:04
  • I'm pretty sure that's not a feature of Octave itself. Did you also change your version of readline? Or more likely, its configuration? – carandraug Oct 26 '15 at 22:06
  • @carandraug, I agree, it must be outside of Octave. Haven't changed `readline` (at least, not willfully). – nightcod3r Oct 26 '15 at 22:14
  • @Daniel: Octave's version updated. – nightcod3r Oct 26 '15 at 22:16
  • 1
    [Here](http://stackoverflow.com/questions/1030182/how-do-i-change-bash-history-completion-to-complete-whats-already-on-the-line)'s the answer for a Unix command line, but doesn't solve the problem in Octave (have run the `bind '"\e[A":history-search-backward'` comand, then started Octave, and it does not autocomplete. And, yes, @carandraug, it's connected to `readline`. – nightcod3r Oct 26 '15 at 22:43
  • This is weird. On the same machine (opensuse 13.2), octave-3.8.2, and octave-4.0.0 compiled on Oct 4 both display the good old behaviour. The development version (20599:ffc6cdcd02c5) compiled on Oct 11 has the problem. But a new (today) compilation of 4.0.0 has the good old behaviour ! And a new (today) compilation of the dev version has the problem. – ederag Oct 29 '15 at 20:30
  • The dev version I mentionned previously was run with the command `run-octave` (without installation). After installation (`make install`), it has the good old behaviour. – ederag Oct 31 '15 at 20:20
  • I'm using Ubuntu 14.04, could it be a distro-dependent problem? – nightcod3r Oct 31 '15 at 21:28
  • Confirmed, it's pretty weird. Octave 3.8.1 is now running it two different tabs of the same terminal, one shows the autocomplete behavior, the other does not. – nightcod3r Nov 01 '15 at 08:00
  • 1
    [Bug](https://savannah.gnu.org/bugs/index.php?46352) reported. – nightcod3r Nov 01 '15 at 09:02
  • 1
    Problem solved, @ederag. – nightcod3r Nov 01 '15 at 19:30
  • @nightcod3r Good, and thanks for the feedback. Could you please post a short answer with a link to the bug report, and accept it, so that your question does not stay in the "unanswered" list ? – ederag Nov 02 '15 at 18:15

1 Answers1

2

This estrange behavior has been solved here, it's just a question of starting Octave without the -f option, which prevents loading the initialization files, including ~/.inputrc, responsible for the history-search-backward behavior.

nightcod3r
  • 752
  • 1
  • 7
  • 26