Bug 140156 - Matlab like history completion
Summary: Matlab like history completion
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.6.5
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-16 14:41 UTC by yuval aviel
Modified: 2007-01-18 07:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yuval aviel 2007-01-16 14:41:01 UTC
Version:           1.6.5 (using KDE 3.5.5-1.4.fc6, Fedora Core release 6 (Zod))
Compiler:          Target: i386-redhat-linux
OS:                Linux (i686) release 2.6.18-1.2869.fc6

In Matlab's console, writing a text and pressing the up arrow complete the text with the last history line that starts with the same text as typed by hand. 
Pressing again on the up arrow, complete the text entered with the matching line in history before the last one, etc...

This is very usefull feature that is most welcome in konsole.
Comment 1 Robert Knight 2007-01-16 16:50:21 UTC
Hello Yuval,

I think you can get what you are after by pressing Ctrl+R in the terminal and then typing in the first few characters of your command.  
Press Ctrl+R and you will see a line like this:

(reverse i-search: '') 

If you have typed in "make install" previously, type in "mak" and it should prompt you with "make install".  Press enter to execute the command.

More information can be found here: http://www.faqs.org/docs/bashman/bashref_95.html

This assumes that you are using a Bash shell ( you can find out by running "echo $SHELL" in the terminal, it will print "/bin/bash" if you are )

Other than that,  it is important to understand the difference between Konsole and the program running in the shell.  Konsole is a "terminal emulator", in other words, a window in which command-line programs can run, accept user input and print output.  It isn't responsible for any of the text you see inside the window or doing anything useful with the input.  That is done by the shell process, typically called bash.  See the web page linked above for bash documentation.
Comment 2 Robert Knight 2007-01-16 16:51:56 UTC
Not a Konsole bug - closing for now.  
Comment 3 yuval aviel 2007-01-16 17:08:56 UTC
Forgot to mention that I am aware of the ctrl-r option.
There is a big difference between the two; in Matlab you can *scroll* between completions, whereas with ctrl-r you can't.
That is if you typed before
make clean
make all
make install

then you type 'ma' you can scroll between all these optional completions!

Not to mention that the up arrow is match more convenient than ctrl-r :(

Comment 4 Robert Knight 2007-01-16 20:39:53 UTC
Hi,

I wouldn't be surprised if other shells provide this facility.  The fish shell provides something fairly similar with Up and Down arrows.

You can use them with Konsole instead of bash.  Go to Settings -> Configure Konsole -> Session Tab.  Select the "Shell" session type and enter the name of the terminal program you want to use in the "Execute" box.
Comment 5 yuval aviel 2007-01-18 07:58:23 UTC
Thank you for the reference to FISH. 
An excellent shell.
Wish i knew about it earlier ...