Class JniTerminalProvider
- All Implemented Interfaces:
org.jline.terminal.spi.TerminalProvider
This provider requires the JLine native library to be loaded, which is handled by
JLineNativeLoader. The native library provides access to
low-level terminal operations that are not available through standard Java APIs.
The native library is automatically loaded when this provider is used. If the library cannot be loaded, the provider will not be available and JLine will fall back to other available providers.
The native library loading can be configured using system properties as documented in
JLineNativeLoader.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new JNI terminal provider instance and ensures the native library is loaded. -
Method Summary
Modifier and TypeMethodDescriptionorg.jline.terminal.spi.Ptycurrent(org.jline.terminal.spi.SystemStream systemStream) intbooleanisPosixSystemStream(org.jline.terminal.spi.SystemStream stream) booleanisSystemStream(org.jline.terminal.spi.SystemStream stream) booleanisWindowsSystemStream(org.jline.terminal.spi.SystemStream stream) name()org.jline.terminal.TerminalnewTerminal(String name, String type, InputStream in, OutputStream out, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.Attributes attributes, org.jline.terminal.Size size) Deprecated.org.jline.terminal.TerminalnewTerminal(String name, String type, InputStream in, OutputStream out, Charset encoding, Charset inputEncoding, Charset outputEncoding, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.Attributes attributes, org.jline.terminal.Size size) org.jline.terminal.spi.Ptyopen(org.jline.terminal.Attributes attributes, org.jline.terminal.Size size) org.jline.terminal.TerminalposixSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) org.jline.terminal.TerminalposixSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) systemStreamName(org.jline.terminal.spi.SystemStream stream) intsystemStreamWidth(org.jline.terminal.spi.SystemStream stream) org.jline.terminal.TerminalsysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, Charset inputEncoding, Charset outputEncoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) org.jline.terminal.TerminalsysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) Deprecated.toString()org.jline.terminal.TerminalwinSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) org.jline.terminal.TerminalwinSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jline.terminal.spi.TerminalProvider
newTerminal, sysTerminal
-
Constructor Details
-
JniTerminalProvider
public JniTerminalProvider()Creates a new JNI terminal provider instance and ensures the native library is loaded.The constructor first checks that native access is enabled for this module. On JDK 22+, calling
System.load()without--enable-native-accessproduces a warning (JDK 24+) or throwsIllegalCallerException(JDK 26+). By checking upfront, this provider fails cleanly and allowsTerminalBuilderto fall back to other providers.- Throws:
UnsupportedOperationException- if native access is not enabled for this module
-
-
Method Details
-
name
- Specified by:
namein interfaceorg.jline.terminal.spi.TerminalProvider
-
getConsoleCodepage
public int getConsoleCodepage()- Specified by:
getConsoleCodepagein interfaceorg.jline.terminal.spi.TerminalProvider
-
current
public org.jline.terminal.spi.Pty current(org.jline.terminal.spi.SystemStream systemStream) throws IOException - Throws:
IOException
-
open
public org.jline.terminal.spi.Pty open(org.jline.terminal.Attributes attributes, org.jline.terminal.Size size) throws IOException - Throws:
IOException
-
sysTerminal
public org.jline.terminal.Terminal sysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, Charset inputEncoding, Charset outputEncoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) throws IOException - Specified by:
sysTerminalin interfaceorg.jline.terminal.spi.TerminalProvider- Throws:
IOException
-
sysTerminal
@Deprecated public org.jline.terminal.Terminal sysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) throws IOException Deprecated.- Specified by:
sysTerminalin interfaceorg.jline.terminal.spi.TerminalProvider- Throws:
IOException
-
winSysTerminal
public org.jline.terminal.Terminal winSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) throws IOException - Throws:
IOException
-
winSysTerminal
public org.jline.terminal.Terminal winSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) throws IOException - Throws:
IOException
-
posixSysTerminal
public org.jline.terminal.Terminal posixSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) throws IOException - Throws:
IOException
-
posixSysTerminal
public org.jline.terminal.Terminal posixSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, boolean nativeSignals, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.spi.SystemStream systemStream) throws IOException - Throws:
IOException
-
newTerminal
public org.jline.terminal.Terminal newTerminal(String name, String type, InputStream in, OutputStream out, Charset encoding, Charset inputEncoding, Charset outputEncoding, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.Attributes attributes, org.jline.terminal.Size size) throws IOException - Specified by:
newTerminalin interfaceorg.jline.terminal.spi.TerminalProvider- Throws:
IOException
-
newTerminal
@Deprecated public org.jline.terminal.Terminal newTerminal(String name, String type, InputStream in, OutputStream out, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.Attributes attributes, org.jline.terminal.Size size) throws IOException Deprecated.- Specified by:
newTerminalin interfaceorg.jline.terminal.spi.TerminalProvider- Throws:
IOException
-
isSystemStream
public boolean isSystemStream(org.jline.terminal.spi.SystemStream stream) - Specified by:
isSystemStreamin interfaceorg.jline.terminal.spi.TerminalProvider
-
isWindowsSystemStream
public boolean isWindowsSystemStream(org.jline.terminal.spi.SystemStream stream) -
isPosixSystemStream
public boolean isPosixSystemStream(org.jline.terminal.spi.SystemStream stream) -
systemStreamName
- Specified by:
systemStreamNamein interfaceorg.jline.terminal.spi.TerminalProvider
-
systemStreamWidth
public int systemStreamWidth(org.jline.terminal.spi.SystemStream stream) - Specified by:
systemStreamWidthin interfaceorg.jline.terminal.spi.TerminalProvider
-
toString
-