Class JansiWinSysTerminal

All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, Terminal

public class JansiWinSysTerminal extends AbstractWindowsTerminal
  • Field Details

    • consoleOut

      private static final long consoleOut
    • consoleIn

      private static final long consoleIn
    • focus

      private char[] focus
    • mouse

      private char[] mouse
  • Constructor Details

  • Method Details

    • createTerminal

      public static JansiWinSysTerminal createTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, int codepage, boolean nativeSignals, Terminal.SignalHandler signalHandler, boolean paused) throws IOException
      Throws:
      IOException
    • isWindowsConsole

      public static boolean isWindowsConsole()
    • isConsoleOutput

      public static boolean isConsoleOutput()
    • isConsoleInput

      public static boolean isConsoleInput()
    • getConsoleMode

      protected int getConsoleMode()
      Specified by:
      getConsoleMode in class AbstractWindowsTerminal
    • setConsoleMode

      protected void setConsoleMode(int mode)
      Specified by:
      setConsoleMode in class AbstractWindowsTerminal
    • getSize

      public Size getSize()
      Description copied from interface: Terminal
      Retrieve the size of the visible window
      Returns:
      the visible terminal size
      See Also:
    • getBufferSize

      public Size getBufferSize()
      Description copied from interface: Terminal
      Retrieve the size of the window buffer. Some terminals can be configured to have a buffer size larger than the visible window size and provide scroll bars. In such cases, this method should attempt to return the size of the whole buffer. The getBufferSize() method can be used to avoid wrapping when using the terminal in a line editing mode, while the Terminal.getSize() method should be used when using full screen mode.
      Returns:
      the terminal buffer size
      See Also:
    • processConsoleInput

      protected boolean processConsoleInput() throws IOException
      Description copied from class: AbstractWindowsTerminal
      Read a single input event from the input buffer and process it.
      Specified by:
      processConsoleInput in class AbstractWindowsTerminal
      Returns:
      true if new input was generated from the event
      Throws:
      IOException - if anything wrong happens
    • processFocusEvent

      private void processFocusEvent(boolean hasFocus) throws IOException
      Throws:
      IOException
    • processMouseEvent

      private void processMouseEvent(org.fusesource.jansi.internal.Kernel32.MOUSE_EVENT_RECORD mouseEvent) throws IOException
      Throws:
      IOException
    • getCursorPosition

      public Cursor getCursorPosition(IntConsumer discarded)
      Description copied from interface: Terminal
      Query 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 using org.jline.keymap.BindingReader#runMacro(String)
      Specified by:
      getCursorPosition in interface Terminal
      Overrides:
      getCursorPosition in class AbstractTerminal
      Parameters:
      discarded - a consumer receiving discarded characters
      Returns:
      null if cursor position reporting is not supported or a valid cursor position
    • disableScrolling

      public void disableScrolling()
    • getLastErrorMessage

      static String getLastErrorMessage()
    • getErrorMessage

      static String getErrorMessage(int errorCode)