fix #6333 (repl tab completion replaces too much)