Terminal – Style of Command Line Editing Used by Terminal Emulator

command linemacosterminal

in bash in gnome terminal in Ubuntu, the command line editing commands are by default emacs-style, and can be changed to vim-style.

In bash in the terminal emulator of Mac, the emacs-style commands don't work. Are the commands just those of a regular text editor?

Best Answer

OS X ships with bash and you will want to set -o vi to get vi-style commands. A very popular choice is zsh and the many customization packages like oh-my-zsh. Neither she'll is fully in either style by default.

For emacs style, it's similar - see this great post for more details:

You switch between the two modes in bash, zsh or ksh with set -o vi or set -o emacs, and with bindkey -e or bindkey -v in tcsh or zsh.