File tree Expand file tree Collapse file tree
terminal/src/main/java/org/jline/terminal/impl/exec Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525import org .jline .terminal .spi .Pty ;
2626import org .jline .terminal .spi .TerminalProvider ;
2727import org .jline .utils .ExecHelper ;
28+ import org .jline .utils .Log ;
2829import org .jline .utils .OSUtils ;
2930
3031public class ExecTerminalProvider implements TerminalProvider {
3132
33+ private static boolean warned ;
34+
3235 public String name () {
3336 return "exec" ;
3437 }
@@ -142,11 +145,21 @@ public String systemStreamName(Stream stream) {
142145 return result .trim ();
143146 }
144147 } catch (Throwable t ) {
148+ if ("java.lang.reflect.InaccessibleObjectException"
149+ .equals (t .getClass ().getName ())
150+ && !warned ) {
151+ Log .warn (
152+ "The ExecTerminalProvider requires the JVM options: '--add-opens java.base/java.lang=ALL-UNNAMED'" );
153+ warned = true ;
154+ }
145155 // ignore
146156 }
147157 return null ;
148158 }
149159
160+ /**
161+ * This requires --add-opens java.base/java.lang=ALL-UNNAMED
162+ */
150163 private ProcessBuilder .Redirect getRedirect (FileDescriptor fd ) throws ReflectiveOperationException {
151164 // This is not really allowed, but this is the only way to redirect the output or error stream
152165 // to the input. This is definitely not something you'd usually want to do, but in the case of
You can’t perform that action at this time.
0 commit comments