Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash usage of vi or emacs

From a programming standpoint, when you set the bash shell to use vi or emacs via

set -o vi

or

set -o emacs

What is actually going on here? I've been reading a book where it claims the bash shell uses either of these editors for the input to the shell itself, but I thought it may have used readline.

like image 894
Recursion Avatar asked Nov 13 '09 02:11

Recursion


1 Answers

Bash is still using readline. Readline uses either emacs or vi mode and setting the mode switches between the various editor modes. You can check the lib/readline folder in the base source code to see the various key bindings.

like image 171
miked Avatar answered Nov 15 '22 08:11

miked