[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

set -o vi not working in bash

Posted on 1999-12-07
12
Medium Priority
?
656 Views
Last Modified: 2013-12-13
I am supposed to be able to use vi command-line editing and command recollection with bash.  set -o vi does not give an error but I can't invoke the previous commands pressing Esc and then k or move the cursor in the command line with h or l.  I am using Dell Dimention XPS T-500 with Complete Mandrake 6.5 distribution.  I will appreciate your help since I got used to vi command-line editing.

0
Comment
Question by:igorfactor
  • 6
  • 2
  • 2
  • +2
12 Comments
 

Author Comment

by:igorfactor
ID: 2263081
Edited text of question.
0
 

Author Comment

by:igorfactor
ID: 2263088
Adjusted points to 60
0
 

Expert Comment

by:dan_2228593
ID: 2264091
so what happens when you use the j, k keys?

also do

set -o vi

then

set -o

to see if vi mode if turned on?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 4

Expert Comment

by:tk36
ID: 2266704
Try Ctrl+P for previous command.
and Ctrl+N for Next command
Then Ctrl+B for backward
and Ctrl+F for forward
0
 

Author Comment

by:igorfactor
ID: 2268977
set -o returns that vi is on.  Ctrl-P etc. don't work
0
 

Author Comment

by:igorfactor
ID: 2277288
The proposed answer doesn't work.  When I hit Esc and then,  say,  'k', I am getting a beep, next keys I hit are typed in the screen.  'set -o' returns that vi is on.
0
 

Author Comment

by:igorfactor
ID: 2277398
The proposed answer doesn't work.  When I hit Esc and then,  say,  'k', I am getting a beep, next keys I hit are typed in the screen.  'set -o' returns that vi is on.
0
 
LVL 4

Expert Comment

by:tk36
ID: 2277809
Sorry iqofactor, It works on SuSE 6.2 and we don't have Mandrake, so we can't investigate for you.
0
 
LVL 3

Accepted Solution

by:
jyu_88 earned 240 total points
ID: 2334168
The /etc/inputrc coming with RedHat has some funky mapping. remove the last several funny looking lines. Wonder if Mandrake would have similar problem.
Another thing to be sure is that you are in a bash. type 'bash' then try 'set -o vi', then try command line editing.
Also, if you are using a telnet client to access your Mandrake box, try different key/simulation mapping such as netterm, etc.
0
 

Expert Comment

by:yubby
ID: 4231417
I believe that the answer actually is (assuming RedHat's installation of the initial "/etc/inputrc" file):

copy /etc/inputrc to /etc/inputrc.org
vi /etc/inputrc

## remove ALL lines since they refer to Emacs controls,  and add the lines:

set editing-mode vi
set keymap vi
0
 

Author Comment

by:igorfactor
ID: 4293969
This is a good idea. But in multiuser environment it would, probably, be better if we put the user preferred options into ~/.inputrc and make  /etc/inputrc have the only line:

$include ~/.inputrc
0
 

Expert Comment

by:yubby
ID: 4294090
All users must submit to "vi"...  (or die..).

If the few (like the DBA's) still want to use Emacs, they can configure it manually (as you suggested above)...

The 'gist' of my suggestion was to change the 'default' from Emacs to vi  (obviously not improving on the 'system-wide' issue...)
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
This installment of Make It Better gives Media Temple customers the latest news, plugins, and tutorials to make their Grid shared hosting experience that much smoother.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

611 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question