- java.lang.Object
-
- org.jline.terminal.impl.AbstractTerminal
-
- org.jline.terminal.impl.AbstractPosixTerminal
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,Terminal
- Direct Known Subclasses:
PosixPtyTerminal,PosixSysTerminal
public abstract class AbstractPosixTerminal extends AbstractTerminal
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jline.terminal.Terminal
Terminal.MouseTracking, Terminal.Signal, Terminal.SignalHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected AttributesoriginalAttributesprotected Ptypty-
Fields inherited from class org.jline.terminal.impl.AbstractTerminal
bools, encoding, handlers, ints, name, onClose, palette, status, strings, type
-
Fields inherited from interface org.jline.terminal.Terminal
TYPE_DUMB, TYPE_DUMB_COLOR
-
-
Constructor Summary
Constructors Constructor Description AbstractPosixTerminal(String name, String type, Pty pty)AbstractPosixTerminal(String name, String type, Pty pty, Charset encoding, Terminal.SignalHandler signalHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoClose()AttributesgetAttributes()CursorgetCursorPosition(IntConsumer discarded)Query the terminal to report the cursor position.PtygetPty()SizegetSize()Retrieve the size of the visible windowvoidsetAttributes(Attributes attr)voidsetSize(Size size)-
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 Detail
-
pty
protected final Pty pty
-
originalAttributes
protected final Attributes originalAttributes
-
-
Constructor Detail
-
AbstractPosixTerminal
public AbstractPosixTerminal(String name, String type, Pty pty) throws IOException
- Throws:
IOException
-
AbstractPosixTerminal
public AbstractPosixTerminal(String name, String type, Pty pty, Charset encoding, Terminal.SignalHandler signalHandler) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getPty
public Pty getPty()
-
getAttributes
public Attributes getAttributes()
-
setAttributes
public void setAttributes(Attributes attr)
-
getSize
public Size getSize()
Description copied from interface:TerminalRetrieve the size of the visible window- Returns:
- the visible terminal size
- See Also:
Terminal.getBufferSize()
-
setSize
public void setSize(Size size)
-
doClose
protected void doClose() throws IOException- Overrides:
doClosein classAbstractTerminal- Throws:
IOException
-
getCursorPosition
public Cursor getCursorPosition(IntConsumer discarded)
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
-
-