Fix #6328 (get out of REPL modes with backspace)