Cursor stays at the end of the command line when filtering history