-
Notifications
You must be signed in to change notification settings - Fork 147
Description
Description:
When running a Java program in Eclipse IDE that uses Scanner.nextLine() for user input, the console fails to reposition the input cursor correctly after an exception or invalid input. Even though the program prints a new prompt using System.out.println("Enter a number:"), the cursor remains stuck on the previous line (next to the error message), requiring manual mouse interaction to continue typing.
NOTE: This issue does not occur in IntelliJ IDEA, where the input cursor automatically moves to the correct line after each prompt.
Steps to Reproduce:
1)Create a Java program that reads user input using Scanner.nextLine().
2)Wrap the input logic in a loop with exception handling.
3)Run the program in Eclipse IDE.
4)Enter an invalid input (e.g., non-numeric string).
5)Observe the cursor position.
Actual Behavior: The cursor stays stuck with the error message, and the user must manually click to reposition it.
Expected Behavior: The input cursor should automatically move to the next line after printing the prompt, allowing the user to type without clicking.
IDE Configuration :
Eclipse IDE for Java Developers (includes Incubating components)
Version: 2023-06 (4.28.0)
Build id: 20230608-1333