Interface ITerminal

All Superinterfaces:
Serializable
All Known Implementing Classes:
PreserveStateAddon, XTerm, XTermBase

public interface ITerminal extends Serializable
The API that represents an xterm.js terminal.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Unfocus the terminal.
    void
    Clear the entire buffer, making the prompt line the new first line.
    void
    Clears the current terminal selection.
    void
    Focus the terminal.
    Gets the terminal's current selection, this is useful for implementing copy behavior outside of xterm.js.
    Gets whether the terminal has an active selection.
    void
    paste(String data)
    Writes text to the terminal, performing the necessary transformations for pasted text.
    void
    refresh(int start, int end)
    Tells the renderer to refresh terminal content between two rows (inclusive) at the next opportunity.
    void
    Perform a full reset (RIS, aka '\x1bc').
    void
    resize(int columns, int rows)
    Resizes the terminal.
    void
    scrollLines(int amount)
    Scroll the display of the terminal
    void
    scrollPages(int pageCount)
    Scroll the display of the terminal by a number of pages.
    void
    Scrolls the display of the terminal to the bottom.
    void
    scrollToLine(int line)
    Scrolls to a line within the buffer.
    void
    Scrolls the display of the terminal to the top.
    void
    select(int column, int row, int length)
    Selects text within the terminal.
    void
    Selects all text within the terminal.
    void
    selectLines(int start, int end)
    Selects text in the buffer between 2 lines.
    void
    write(String data)
    Write data to the terminal.
    void
    Writes data to the terminal, followed by a break line character (\n).
  • Method Details

    • blur

      void blur()
      Unfocus the terminal.
    • focus

      void focus()
      Focus the terminal.
    • hasSelection

      CompletableFuture<Boolean> hasSelection()
      Gets whether the terminal has an active selection.
    • getSelection

      CompletableFuture<String> getSelection()
      Gets the terminal's current selection, this is useful for implementing copy behavior outside of xterm.js.
    • clearSelection

      void clearSelection()
      Clears the current terminal selection.
    • select

      void select(int column, int row, int length)
      Selects text within the terminal.
      Parameters:
      column - The column the selection starts at.
      row - The row the selection starts at.
      length - The length of the selection.
    • selectAll

      void selectAll()
      Selects all text within the terminal.
    • selectLines

      void selectLines(int start, int end)
      Selects text in the buffer between 2 lines.
      Parameters:
      start - The 0-based line index to select from (inclusive).
      end - The 0-based line index to select to (inclusive).
    • scrollLines

      void scrollLines(int amount)
      Scroll the display of the terminal
      Parameters:
      amount - The number of lines to scroll down (negative scroll up).
    • scrollPages

      void scrollPages(int pageCount)
      Scroll the display of the terminal by a number of pages.
      Parameters:
      pageCount - The number of pages to scroll (negative scrolls up).
    • scrollToTop

      void scrollToTop()
      Scrolls the display of the terminal to the top.
    • scrollToBottom

      void scrollToBottom()
      Scrolls the display of the terminal to the bottom.
    • scrollToLine

      void scrollToLine(int line)
      Scrolls to a line within the buffer.
      Parameters:
      line - The 0-based line index to scroll to.
    • clear

      void clear()
      Clear the entire buffer, making the prompt line the new first line.
    • write

      void write(String data)
      Write data to the terminal.
      Parameters:
      data - The data to write to the terminal.
    • writeln

      void writeln(String data)
      Writes data to the terminal, followed by a break line character (\n).
      Parameters:
      data - The data to write to the terminal. This can either be raw bytes given as Uint8Array from the pty or a string. Raw bytes will always be treated as UTF-8 encoded, string data as UTF-16.
    • paste

      void paste(String data)
      Writes text to the terminal, performing the necessary transformations for pasted text.
      Parameters:
      data - The text to write to the terminal.
    • refresh

      void refresh(int start, int end)
      Tells the renderer to refresh terminal content between two rows (inclusive) at the next opportunity.
      Parameters:
      start - The row to start from (between 0 and this.rows - 1).
      end - The row to end at (between start and this.rows - 1).
    • reset

      void reset()
      Perform a full reset (RIS, aka '\x1bc').
    • resize

      void resize(int columns, int rows)
      Resizes the terminal. Set the number of columns and rows in the terminal.