Package org.jline.terminal.impl.ffm
Class FfmTerminalProvider
java.lang.Object
org.jline.terminal.impl.ffm.FfmTerminalProvider
- All Implemented Interfaces:
org.jline.terminal.spi.TerminalProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanisPosixSystemStream(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 inputEncoding, Charset outputEncoding, org.jline.terminal.Terminal.SignalHandler signalHandler, boolean paused, org.jline.terminal.Attributes attributes, org.jline.terminal.Size size) registerDefaultSignal(String signal) Register the default handler for the specified signal, preferring the FFM handler if available.registerSignal(String signal, Runnable handler) Register a handler to be invoked when the specified signal is delivered.systemStreamName(org.jline.terminal.spi.SystemStream stream) intsystemStreamWidth(org.jline.terminal.spi.SystemStream stream) Obtain the current width, in columns, of the specified system 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) Creates a Terminal bound to the process system streams (stdin/stdout/stderr) or an equivalent PTY-backed terminal.toString()Provide a short identifying string for this terminal provider.voidunregisterSignal(String signal, Object registration) Unregisters a previously registered signal handler; uses FFM unregistration when the provided registration is an FFM registration, otherwise uses the platform fallback.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jline.terminal.spi.TerminalProvider
sysTerminal
-
Constructor Details
-
FfmTerminalProvider
public FfmTerminalProvider()
-
-
Method Details
-
name
- Specified by:
namein interfaceorg.jline.terminal.spi.TerminalProvider
-
getConsoleCodepage
public int getConsoleCodepage()- Specified by:
getConsoleCodepagein interfaceorg.jline.terminal.spi.TerminalProvider
-
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 Creates a Terminal bound to the process system streams (stdin/stdout/stderr) or an equivalent PTY-backed terminal.- Specified by:
sysTerminalin interfaceorg.jline.terminal.spi.TerminalProvider- Parameters:
name- terminal name or identifiertype- terminal type (TERM)ansiPassThrough- ignored on POSIX — only used on Windowsencoding- overall character set for the terminalinputEncoding- character set used for input decodingoutputEncoding- character set used for output encodingnativeSignals- if true, attempt to use native signal handling when availablesignalHandler- handler invoked for terminal signalspaused- ignored on POSIX — only used on Windows and PTY-backed terminalssystemStream- which system stream this terminal should be associated with- Returns:
- a Terminal instance bound to the specified system stream (or an equivalent PTY-backed terminal)
- Throws:
IOException- if the native PTY or system terminal cannot be created or accessed
-
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
-
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) Obtain the current width, in columns, of the specified system stream.- Specified by:
systemStreamWidthin interfaceorg.jline.terminal.spi.TerminalProvider- Parameters:
stream- the system stream whose width to query- Returns:
- the width in columns of the given system stream
-
registerSignal
Register a handler to be invoked when the specified signal is delivered.- Specified by:
registerSignalin interfaceorg.jline.terminal.spi.TerminalProvider- Parameters:
signal- the name of the signal to handle (platform-specific string)handler- the runnable to execute when the signal is received- Returns:
- an opaque registration handle that can be passed to
unregisterSignalto remove the handler
-
registerDefaultSignal
Register the default handler for the specified signal, preferring the FFM handler if available.- Specified by:
registerDefaultSignalin interfaceorg.jline.terminal.spi.TerminalProvider- Parameters:
signal- the name of the signal (for example, "INT" or "TERM")- Returns:
- an object representing the installed registration; the FFM registration if one was created, otherwise the fallback Signals registration
-
unregisterSignal
Unregisters a previously registered signal handler; uses FFM unregistration when the provided registration is an FFM registration, otherwise uses the platform fallback.- Specified by:
unregisterSignalin interfaceorg.jline.terminal.spi.TerminalProvider- Parameters:
signal- the name of the signal to unregister (e.g., "INT", "TERM")registration- the registration token returned by a prior register call
-
toString
-