Sample Header Ad - 728x90

Moving cursor to end of line when using history-search-backward

7 votes
1 answer
2087 views
I recently added the following lines to my .inputrc:
"\e[A": history-search-backward
"\e[B": history-search-forward
However, I noticed when using this that my cursor does not jump to the end of the line. For example, if I type ls then hit up, my terminal will look like this (| being the cursors):
ls |verylongdir
What I want is:
ls verylongdir|
I believe zsh behaves this way with the same command. Is there any way to do this in bash?
Asked by John Howard (191 rep)
Feb 24, 2017, 05:38 PM
Last activity: May 29, 2025, 09:01 AM