Package org.jline.terminal.impl
Class AbstractPosixTerminal
java.lang.Object
org.jline.terminal.impl.AbstractTerminal
org.jline.terminal.impl.AbstractPosixTerminal
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,TerminalExt,Terminal
- Direct Known Subclasses:
PosixPtyTerminal,PosixSysTerminal
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jline.terminal.Terminal
Terminal.MouseTracking, Terminal.Signal, Terminal.SignalHandler -
Field Summary
FieldsFields inherited from class org.jline.terminal.impl.AbstractTerminal
bools, encoding, handlers, ints, name, onClose, palette, status, strings, typeFields inherited from interface org.jline.terminal.Terminal
TYPE_DUMB, TYPE_DUMB_COLOR -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPosixTerminal(String name, String type, Pty pty) AbstractPosixTerminal(String name, String type, Pty pty, Charset encoding, Terminal.SignalHandler signalHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoClose()Returns the terminal attributes.getCursorPosition(IntConsumer discarded) Query the terminal to report the cursor position.Returns theTerminalProviderthat created this terminal ornullif the terminal was created with no provider.getPty()getSize()Retrieve the size of the visible windowThe underlying system stream, may beSystemStream.Output,SystemStream.Error, ornullif this terminal is not bound to a system stream.voidsetAttributes(Attributes attr) Set the terminal attributes.voidtoString()Methods inherited from class org.jline.terminal.impl.AbstractTerminal
canPauseResume, checkInterrupted, close, echo, echo, echoSignal, encoding, enterRawMode, flush, getBooleanCapability, getKind, getName, getNumericCapability, getPalette, getStatus, getStatus, getStringCapability, getType, handle, hasFocusSupport, hasMouseSupport, parseInfoCmp, pause, pause, paused, puts, raise, readMouseEvent, readMouseEvent, resume, setOnClose, trackFocus, trackMouse
-
Field Details
-
pty
-
originalAttributes
-
-
Constructor Details
-
AbstractPosixTerminal
- Throws:
IOException
-
AbstractPosixTerminal
public AbstractPosixTerminal(String name, String type, Pty pty, Charset encoding, Terminal.SignalHandler signalHandler) throws IOException - Throws:
IOException
-
-
Method Details
-
getPty
-
getAttributes
Description copied from interface:TerminalReturns the terminal attributes. The returned object can be safely modified further used in a call toTerminal.setAttributes(Attributes).- Returns:
- the terminal attributes.
-
setAttributes
Description copied from interface:TerminalSet the terminal attributes. The terminal will perform a copy of the given attributes.- Parameters:
attr- the new attributes
-
getSize
-
setSize
-
doClose
- Overrides:
doClosein classAbstractTerminal- Throws:
IOException
-
getCursorPosition
Description copied from interface:TerminalQuery the terminal to report the cursor position. As the response is read from the input stream, some characters may be read before the cursor position is actually read. Those characters can be given back usingorg.jline.keymap.BindingReader#runMacro(String)- Specified by:
getCursorPositionin interfaceTerminal- Overrides:
getCursorPositionin classAbstractTerminal- Parameters:
discarded- a consumer receiving discarded characters- Returns:
nullif cursor position reporting is not supported or a valid cursor position
-
getProvider
Description copied from interface:TerminalExtReturns theTerminalProviderthat created this terminal ornullif the terminal was created with no provider. -
getSystemStream
Description copied from interface:TerminalExtThe underlying system stream, may beSystemStream.Output,SystemStream.Error, ornullif this terminal is not bound to a system stream. -
toString
- Overrides:
toStringin classAbstractTerminal
-