Class JansiNativePty
- java.lang.Object
-
- org.jline.terminal.impl.AbstractPty
-
- org.jline.terminal.impl.jansi.JansiNativePty
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Pty
- Direct Known Subclasses:
FreeBsdNativePty,LinuxNativePty,OsXNativePty,SolarisNativePty
public abstract class JansiNativePty extends AbstractPty implements Pty
-
-
Field Summary
-
Fields inherited from class org.jline.terminal.impl.AbstractPty
provider, systemStream
-
-
Constructor Summary
Constructors Constructor Description JansiNativePty(TerminalProvider provider, SystemStream systemStream, int master, java.io.FileDescriptor masterFD, int slave, java.io.FileDescriptor slaveFD, int slaveOut, java.io.FileDescriptor slaveOutFD, java.lang.String name)JansiNativePty(TerminalProvider provider, SystemStream systemStream, int master, java.io.FileDescriptor masterFD, int slave, java.io.FileDescriptor slaveFD, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected java.io.InputStreamdoGetSlaveInput()protected voiddoSetAttr(Attributes attr)AttributesgetAttr()Returns the current terminal attributes for this PTY.intgetMaster()java.io.FileDescriptorgetMasterFD()java.io.InputStreamgetMasterInput()Returns the input stream for the master side of the PTY.java.io.OutputStreamgetMasterOutput()Returns the output stream for the master side of the PTY.java.lang.StringgetName()SizegetSize()Returns the current size (dimensions) of this PTY.intgetSlave()java.io.FileDescriptorgetSlaveFD()intgetSlaveOut()java.io.FileDescriptorgetSlaveOutFD()java.io.OutputStreamgetSlaveOutput()Returns the output stream for the slave side of the PTY.static booleanisPosixSystemStream(SystemStream stream)static java.lang.StringposixSystemStreamName(SystemStream systemStream)voidsetSize(Size size)Sets the size (dimensions) of this PTY.static intsystemStreamWidth(SystemStream systemStream)protected abstract AttributestoAttributes(org.fusesource.jansi.internal.CLibrary.Termios tios)java.lang.StringtoString()protected abstract org.fusesource.jansi.internal.CLibrary.TermiostoTermios(Attributes t)protected static java.lang.Stringttyname()-
Methods inherited from class org.jline.terminal.impl.AbstractPty
checkInterrupted, 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
getProvider, getSlaveInput, getSystemStream, setAttr
-
-
-
-
Constructor Detail
-
JansiNativePty
public JansiNativePty(TerminalProvider provider, SystemStream systemStream, int master, java.io.FileDescriptor masterFD, int slave, java.io.FileDescriptor slaveFD, java.lang.String name)
-
JansiNativePty
public JansiNativePty(TerminalProvider provider, SystemStream systemStream, int master, java.io.FileDescriptor masterFD, int slave, java.io.FileDescriptor slaveFD, int slaveOut, java.io.FileDescriptor slaveOutFD, java.lang.String name)
-
-
Method Detail
-
ttyname
protected static java.lang.String ttyname() throws java.io.IOException- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
getMaster
public int getMaster()
-
getSlave
public int getSlave()
-
getSlaveOut
public int getSlaveOut()
-
getName
public java.lang.String getName()
-
getMasterFD
public java.io.FileDescriptor getMasterFD()
-
getSlaveFD
public java.io.FileDescriptor getSlaveFD()
-
getSlaveOutFD
public java.io.FileDescriptor getSlaveOutFD()
-
getMasterInput
public java.io.InputStream getMasterInput()
Description copied from interface:PtyReturns 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:
getMasterInputin interfacePty- Returns:
- the master's input stream
-
getMasterOutput
public java.io.OutputStream getMasterOutput()
Description copied from interface:PtyReturns 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:
getMasterOutputin interfacePty- Returns:
- the master's output stream
-
doGetSlaveInput
protected java.io.InputStream doGetSlaveInput()
- Specified by:
doGetSlaveInputin classAbstractPty
-
getSlaveOutput
public java.io.OutputStream getSlaveOutput()
Description copied from interface:PtyReturns 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:
getSlaveOutputin interfacePty- Returns:
- the slave's output stream
-
getAttr
public Attributes getAttr() throws java.io.IOException
Description copied from interface:PtyReturns the current terminal attributes for this PTY.Terminal attributes control various aspects of terminal behavior, such as echo settings, line discipline, and control characters.
- Specified by:
getAttrin interfacePty- Returns:
- the current terminal attributes
- Throws:
java.io.IOException- if an I/O error occurs- See Also:
Attributes
-
doSetAttr
protected void doSetAttr(Attributes attr) throws java.io.IOException
- Specified by:
doSetAttrin classAbstractPty- Throws:
java.io.IOException
-
getSize
public Size getSize() throws java.io.IOException
Description copied from interface:PtyReturns the current size (dimensions) of this PTY.The size includes the number of rows and columns in the terminal window.
-
setSize
public void setSize(Size size) throws java.io.IOException
Description copied from interface:PtySets the size (dimensions) of this PTY.This method changes the number of rows and columns in the terminal window. When the size changes, a SIGWINCH signal is typically sent to processes running in the terminal.
-
toTermios
protected abstract org.fusesource.jansi.internal.CLibrary.Termios toTermios(Attributes t)
-
toAttributes
protected abstract Attributes toAttributes(org.fusesource.jansi.internal.CLibrary.Termios tios)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isPosixSystemStream
public static boolean isPosixSystemStream(SystemStream stream)
-
posixSystemStreamName
public static java.lang.String posixSystemStreamName(SystemStream systemStream)
-
systemStreamWidth
public static int systemStreamWidth(SystemStream systemStream)
-
-