Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

arrow keys are not functional in sqlplus

I find that the arrow keys don't work on the sqlplus console. For example if I press left arrow key, it shows like

SQL>^[[B 

Does any solutions exist to solve this problem?

like image 994
daizuozhuo Avatar asked Mar 27 '12 13:03

daizuozhuo


People also ask

What is the function of arrows key?

Arrow keys or cursor movement keys are buttons on a computer keyboard that are either programmed or designated to move the cursor in a specified direction.


1 Answers

You can use a third party utility called rlwrap.

rlwrap is a readline wrapper, a small utility that uses the GNU readline library to allow the editing of keyboard input for any other command. It maintains a separate input history for each command, and can TAB-expand words using all previously seen words and/or a user-specified file.

So you will be able to use arrows and also get a command history as a bonus.

After you have installed the utility run sqlplus the following way:

$ rlwrap sqlplus 
like image 168
Johnny Baloney Avatar answered Sep 29 '22 16:09

Johnny Baloney