From c6378cdb1798d185bcae677c59cf6b2c82a1eae1 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Tue, 10 Dec 2024 21:05:17 +0100 Subject: [PATCH] JLine exec provider should reject terminal creation on a redirected output stream (fixes #1098) (#1130) --- .../org/jline/terminal/impl/exec/ExecTerminalProvider.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/terminal/src/main/java/org/jline/terminal/impl/exec/ExecTerminalProvider.java b/terminal/src/main/java/org/jline/terminal/impl/exec/ExecTerminalProvider.java index 6ab20ec66..a3ef547a7 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/exec/ExecTerminalProvider.java +++ b/terminal/src/main/java/org/jline/terminal/impl/exec/ExecTerminalProvider.java @@ -45,6 +45,9 @@ public String name() { } public Pty current(SystemStream systemStream) throws IOException { + if (!isSystemStream(systemStream)) { + throw new IOException("Not a system stream: " + systemStream); + } return ExecPty.current(this, systemStream); }