Linux – In Bash (Mac/Linux terminal shell), can the up and down arrow keys be made to function as they do in text editors

bashcommand linelinuxmacosterminal

In text editors, if I press the up and down arrow keys, it moves the cursor between lines of text.

In Bash, if I’m typing a long command that spans multiple lines and I press the up and down arrow keys, it cycles through the command history.

I want the former behavior in Bash. Is this possible? If not, is there any way to move the cursor directly up or down in a multi-line command?

Best Answer

No, it's not possible. Bash uses GNU Readline to handle interactive line input. There is no command in Readline that moves between display lines as you desire, nor is there a configuration variable comparable to the line-move-visual variable of GNU Emacs that causes next-line and previous-line to move by display lines.

Related Question