Fix bug in command history traversal, left out cursor reset