move the cursor to the end of the input when navigating through commands in history