Package org.jline.terminal.impl.jna
Class JnaNativePty
java.lang.Object
org.jline.terminal.impl.AbstractPty
org.jline.terminal.impl.jna.JnaNativePty
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Pty
- Direct Known Subclasses:
FreeBsdNativePty
,LinuxNativePty
,OsXNativePty
,SolarisNativePty
-
Field Summary
Fields inherited from class org.jline.terminal.impl.AbstractPty
provider, systemStream
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
JnaNativePty
(TerminalProvider provider, SystemStream systemStream, int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, int slaveOut, FileDescriptor slaveOutFD, String name) protected
JnaNativePty
(TerminalProvider provider, SystemStream systemStream, int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static JnaNativePty
current
(TerminalProvider provider, SystemStream systemStream) protected InputStream
int
Returns the input stream for the master side of the PTY.Returns the output stream for the master side of the PTY.getName()
int
getSlave()
int
Returns the output stream for the slave side of the PTY.static boolean
isPosixSystemStream
(SystemStream stream) static JnaNativePty
open
(TerminalProvider provider, Attributes attr, Size size) static String
posixSystemStreamName
(SystemStream stream) toString()
Methods inherited from class org.jline.terminal.impl.AbstractPty
checkInterrupted, doSetAttr, getProvider, getSlaveInput, getSystemStream, newDescriptor, setAttr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jline.terminal.spi.Pty
getAttr, getProvider, getSize, getSlaveInput, getSystemStream, setAttr, setSize
-
Constructor Details
-
JnaNativePty
protected JnaNativePty(TerminalProvider provider, SystemStream systemStream, int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, String name) -
JnaNativePty
protected JnaNativePty(TerminalProvider provider, SystemStream systemStream, int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, int slaveOut, FileDescriptor slaveOutFD, String name)
-
-
Method Details
-
current
public static JnaNativePty current(TerminalProvider provider, SystemStream systemStream) throws IOException - Throws:
IOException
-
open
public static JnaNativePty open(TerminalProvider provider, Attributes attr, Size size) throws IOException - Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getMaster
public int getMaster() -
getSlave
public int getSlave() -
getSlaveOut
public int getSlaveOut() -
getName
-
getMasterFD
-
getSlaveFD
-
getSlaveOutFD
-
getMasterInput
Description copied from interface:Pty
Returns the input stream for the master side of the PTY.This stream receives data that has been written to the slave's output stream. Terminal emulators typically read from this stream to get the output from processes running in the terminal.
- Specified by:
getMasterInput
in interfacePty
- Returns:
- the master's input stream
-
getMasterOutput
Description copied from interface:Pty
Returns the output stream for the master side of the PTY.Data written to this stream will be available for reading from the slave's input stream. Terminal emulators typically write to this stream to send input to processes running in the terminal.
- Specified by:
getMasterOutput
in interfacePty
- Returns:
- the master's output stream
-
doGetSlaveInput
- Specified by:
doGetSlaveInput
in classAbstractPty
-
getSlaveOutput
Description copied from interface:Pty
Returns the output stream for the slave side of the PTY.Data written to this stream will be available for reading from the master's input stream. Processes running in the terminal write to this stream to produce their output.
- Specified by:
getSlaveOutput
in interfacePty
- Returns:
- the slave's output stream
-
toString
-
isPosixSystemStream
-
posixSystemStreamName
-