Class CygwinTerminal

All Implemented Interfaces:
Scrollable, InputProvider, ExtendedTerminal, Terminal, Closeable, AutoCloseable

public class CygwinTerminal extends UnixLikeTTYTerminal
This class extends UnixLikeTerminal and implements the Cygwin-specific implementations. This means, running a Java application using Lanterna inside the Cygwin Terminal application. The standard Windows command prompt (cmd.exe) is not supported by this class.

NOTE: This class is experimental and does not fully work! Some of the operations, like disabling echo and changing cbreak seems to be impossible to do without resorting to native code. Running "stty raw" before starting the JVM will improve compatibility.

NOTE: This class will try to find Cygwin by scanning the directories on java.library.path, but you can also tell it where Cygwin is installed by setting the CYGWIN_HOME environment variable.

  • Field Details

    • STTY_LOCATION

      private static final String STTY_LOCATION
    • STTY_SIZE_PATTERN

      private static final Pattern STTY_SIZE_PATTERN
    • JAVA_LIBRARY_PATH_PROPERTY

      private static final String JAVA_LIBRARY_PATH_PROPERTY
      See Also:
    • CYGWIN_HOME_ENV

      private static final String CYGWIN_HOME_ENV
      See Also:
  • Constructor Details

    • CygwinTerminal

      public CygwinTerminal(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset) throws IOException
      Creates a new CygwinTerminal based off input and output streams and a character set to use
      Parameters:
      terminalInput - Input stream to read input from
      terminalOutput - Output stream to write output to
      terminalCharset - Character set to use when writing to the output stream
      Throws:
      IOException - If there was an I/O error when trying to initialize the class and setup the terminal
  • Method Details