Class JansiNativePty
- 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
ConstructorsConstructorDescriptionJansiNativePty
(TerminalProvider provider, SystemStream systemStream, int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, int slaveOut, FileDescriptor slaveOutFD, String name) JansiNativePty
(TerminalProvider provider, SystemStream systemStream, int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected InputStream
protected void
doSetAttr
(Attributes attr) getAttr()
Returns the current terminal attributes for this PTY.int
Returns the input stream for the master side of the PTY.Returns the output stream for the master side of the PTY.getName()
getSize()
Returns the current size (dimensions) of this PTY.int
getSlave()
int
Returns the output stream for the slave side of the PTY.static boolean
isPosixSystemStream
(SystemStream stream) static String
posixSystemStreamName
(SystemStream systemStream) void
Sets the size (dimensions) of this PTY.static int
systemStreamWidth
(SystemStream systemStream) protected abstract Attributes
toAttributes
(org.fusesource.jansi.internal.CLibrary.Termios tios) toString()
protected abstract org.fusesource.jansi.internal.CLibrary.Termios
protected static String
ttyname()
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 Details
-
JansiNativePty
public JansiNativePty(TerminalProvider provider, SystemStream systemStream, int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, String name) -
JansiNativePty
public JansiNativePty(TerminalProvider provider, SystemStream systemStream, int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, int slaveOut, FileDescriptor slaveOutFD, String name)
-
-
Method Details
-
ttyname
- 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
-
getAttr
Description copied from interface:Pty
Returns 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:
getAttr
in interfacePty
- Returns:
- the current terminal attributes
- Throws:
IOException
- if an I/O error occurs- See Also:
-
doSetAttr
- Specified by:
doSetAttr
in classAbstractPty
- Throws:
IOException
-
getSize
Description copied from interface:Pty
Returns the current size (dimensions) of this PTY.The size includes the number of rows and columns in the terminal window.
- Specified by:
getSize
in interfacePty
- Returns:
- the current terminal size
- Throws:
IOException
- if an I/O error occurs- See Also:
-
setSize
Description copied from interface:Pty
Sets 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.
- Specified by:
setSize
in interfacePty
- Parameters:
size
- the new terminal size to set- Throws:
IOException
- if an I/O error occurs- See Also:
-
toTermios
-
toAttributes
-
toString
-
isPosixSystemStream
-
posixSystemStreamName
-
systemStreamWidth
-