Package jline

Class DefaultTerminal2

  • All Implemented Interfaces:
    Terminal, Terminal2

    public class DefaultTerminal2
    extends java.lang.Object
    implements Terminal2
    Terminal wrapper with default ansi capabilities
    • Field Detail

      • terminal

        private final Terminal terminal
      • bools

        private final java.util.Set<java.lang.String> bools
      • strings

        private final java.util.Map<java.lang.String,​java.lang.String> strings
    • Constructor Detail

      • DefaultTerminal2

        public DefaultTerminal2​(Terminal terminal)
    • Method Detail

      • init

        public void init()
                  throws java.lang.Exception
        Specified by:
        init in interface Terminal
        Throws:
        java.lang.Exception
      • restore

        public void restore()
                     throws java.lang.Exception
        Specified by:
        restore in interface Terminal
        Throws:
        java.lang.Exception
      • reset

        public void reset()
                   throws java.lang.Exception
        Specified by:
        reset in interface Terminal
        Throws:
        java.lang.Exception
      • getWidth

        public int getWidth()
        Specified by:
        getWidth in interface Terminal
      • wrapOutIfNeeded

        public java.io.OutputStream wrapOutIfNeeded​(java.io.OutputStream out)
        Description copied from interface: Terminal
        When ANSI is not natively handled, the output will have to be wrapped.
        Specified by:
        wrapOutIfNeeded in interface Terminal
      • wrapInIfNeeded

        public java.io.InputStream wrapInIfNeeded​(java.io.InputStream in)
                                           throws java.io.IOException
        Description copied from interface: Terminal
        When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.
        Specified by:
        wrapInIfNeeded in interface Terminal
        Throws:
        java.io.IOException
      • hasWeirdWrap

        public boolean hasWeirdWrap()
        Description copied from interface: Terminal
        For terminals that don't wrap when character is written in last column, only when the next character is written. These are the ones that have 'am' and 'xn' termcap attributes (xterm and rxvt flavors falls under that category)
        Specified by:
        hasWeirdWrap in interface Terminal
      • setEchoEnabled

        public void setEchoEnabled​(boolean enabled)
        Specified by:
        setEchoEnabled in interface Terminal
      • registerCap

        private void registerCap​(java.lang.String cap,
                                 java.lang.String value)
      • registerCap

        private void registerCap​(java.lang.String cap)
      • getBooleanCapability

        public boolean getBooleanCapability​(java.lang.String capability)
        Specified by:
        getBooleanCapability in interface Terminal2
      • getNumericCapability

        public java.lang.Integer getNumericCapability​(java.lang.String capability)
        Specified by:
        getNumericCapability in interface Terminal2
      • getStringCapability

        public java.lang.String getStringCapability​(java.lang.String capability)
        Specified by:
        getStringCapability in interface Terminal2