Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Terminal Component #189

Open
hyyan opened this issue Jul 16, 2024 · 0 comments · May be fixed by #315
Open

Document Terminal Component #189

hyyan opened this issue Jul 16, 2024 · 0 comments · May be fixed by #315
Assignees

Comments

@hyyan
Copy link
Member

hyyan commented Jul 16, 2024

webforj/webforj#662
webforj/webforj#676

Overview

The purpose and key features of the component. it uses xterm.js:

  1. Terminal Emulation: a terminal emulator that enables developers to integrate fully-featured, customizable terminal interfaces into browser-based applications.

    • It supports escape sequences and renders terminal output similar to traditional terminal environments.
  2. Supported Terminal Sequences:
    Terminal sequences are categorized by their type:

    • C0: Single-byte commands (7-bit control codes, byte range: \x00 to \x1F, \x7F).
    • C1: Single-byte commands (8-bit control codes, byte range: \x80 to \x9F).
    • ESC: Sequences starting with ESC (\x1B).
    • CSI (Control Sequence Introducer): Sequences starting with ESC [ (7-bit) or CSI (\x9B, 8-bit).
    • DCS (Device Control String): Sequences starting with ESC P (7-bit) or DCS (\x90, 8-bit).
    • OSC (Operating System Command): Sequences starting with ESC ] (7-bit) or OSC (\x9D, 8-bit).

Properties and Customization

  • Configurable Attributes: Attributes such as rows, columns, autoFit, options, and theme can be tailored to fit application requirements.
  • Customization:
    • Use TerminalOptions to define terminal configurations.
    • Use TerminalTheme to customize the terminal's appearance.

Methods

  • Common API methods for interacting with the terminal include:
    • write: Writes data to the terminal. Supports callbacks for processing completion.
    • clear: Clears the terminal content.
    • focus: Focuses the terminal.
    • ....

Events

  • Supports handling events such as terminal data and key interactions:
    • TerminalDataEvent: Triggered when data is processed in the terminal.
    • TerminalKeyEvent: Triggered when a key is pressed in the terminal.

Integration

  • A comprehensive demo is available to showcase terminal capabilities and features in practical scenarios (Check this demo
@laurenic0l laurenic0l self-assigned this Nov 5, 2024
@laurenic0l laurenic0l linked a pull request Nov 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants