mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-12 11:28:35 +00:00
8166890: JShell: locks forever when input is piped
Only read cursor position if connected to a terminal. Reviewed-by: rfield, shinyafox
This commit is contained in:
parent
7bf6362c3a
commit
b765ef344a
@ -2339,7 +2339,7 @@ public class ConsoleReader
|
||||
|
||||
Stack<Character> pushBackChar = new Stack<Character>();
|
||||
|
||||
if (terminal.isAnsiSupported()) {
|
||||
if (terminal.isAnsiSupported() && System.console() != null) {
|
||||
//detect the prompt length by reading the cursor position from the terminal
|
||||
//the real prompt length could differ from the simple prompt length due to
|
||||
//use of escape sequences:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user