gespenst API - v0.1.0
    Preparing search index...

    Interface ITerminalOptions

    An object containing options for the terminal.

    interface ITerminalOptions {
        allowProposedApi?: boolean;
        allowTransparency?: boolean;
        altClickMovesCursor?: boolean;
        convertEol?: boolean;
        cursorBlink?: boolean;
        cursorInactiveStyle?: "block" | "underline" | "bar" | "outline" | "none";
        cursorStyle?: "block" | "underline" | "bar";
        cursorWidth?: number;
        customGlyphs?: boolean;
        disableStdin?: boolean;
        documentOverride?: any;
        drawBoldTextInBrightColors?: boolean;
        fastScrollSensitivity?: number;
        fontFamily?: string;
        fontSize?: number;
        fontWeight?: FontWeight;
        fontWeightBold?: FontWeight;
        ignoreBracketedPasteMode?: boolean;
        letterSpacing?: number;
        lineHeight?: number;
        linkHandler?: ILinkHandler | null;
        logger?: ILogger | null;
        logLevel?: LogLevel;
        macOptionClickForcesSelection?: boolean;
        macOptionIsMeta?: boolean;
        minimumContrastRatio?: number;
        overviewRuler?: IOverviewRulerOptions;
        reflowCursorLine?: boolean;
        rescaleOverlappingGlyphs?: boolean;
        rightClickSelectsWord?: boolean;
        screenReaderMode?: boolean;
        scrollback?: number;
        scrollOnEraseInDisplay?: boolean;
        scrollOnUserInput?: boolean;
        scrollSensitivity?: number;
        smoothScrollDuration?: number;
        tabStopWidth?: number;
        theme?: ITheme;
        windowOptions?: IWindowOptions;
        windowsPty?: IWindowsPty;
        wordSeparator?: string;
    }
    Index
    allowProposedApi?: boolean

    Whether to allow the use of proposed API. When false, any usage of APIs marked as experimental/proposed will throw an error. The default is false.

    allowTransparency?: boolean

    Whether background should support non-opaque color. It must be set before executing the Terminal.open() method and can't be changed later without executing it again. Note that enabling this can negatively impact performance.

    altClickMovesCursor?: boolean

    If enabled, alt + click will move the prompt cursor to position underneath the mouse. The default is true.

    convertEol?: boolean

    When enabled the cursor will be set to the beginning of the next line with every new line. This is equivalent to sending \r\n for each \n. Normally the settings of the underlying PTY (termios) deal with the translation of \n to \r\n and this setting should not be used. If you deal with data from a non-PTY related source, this settings might be useful.

    cursorBlink?: boolean

    Whether the cursor blinks.

    cursorInactiveStyle?: "block" | "underline" | "bar" | "outline" | "none"

    The style of the cursor when the terminal is not focused.

    cursorStyle?: "block" | "underline" | "bar"

    The style of the cursor when the terminal is focused.

    cursorWidth?: number

    The width of the cursor in CSS pixels when cursorStyle is set to 'bar'.

    customGlyphs?: boolean

    Whether to draw custom glyphs for block element and box drawing characters instead of using the font. This should typically result in better rendering with continuous lines, even when line height and letter spacing is used. Note that this doesn't work with the DOM renderer which renders all characters using the font. The default is true.

    disableStdin?: boolean

    Whether input should be disabled.

    documentOverride?: any

    A Document to use instead of the one that xterm.js was attached to. The purpose of this is to improve support in multi-window applications where HTML elements may be references across multiple windows which can cause problems with instanceof.

    The type is any because using Document can cause TS to have performance/compiler problems.

    drawBoldTextInBrightColors?: boolean

    Whether to draw bold text in bright colors. The default is true.

    fastScrollSensitivity?: number

    The scroll speed multiplier used for fast scrolling when Alt is held.

    fontFamily?: string

    The font family used to render text.

    fontSize?: number

    The font size used to render text.

    fontWeight?: FontWeight

    The font weight used to render non-bold text.

    fontWeightBold?: FontWeight

    The font weight used to render bold text.

    ignoreBracketedPasteMode?: boolean

    Whether to ignore the bracketed paste mode. When true, this will always paste without the \x1b[200~ and \x1b[201~ sequences, even when the shell enables bracketed mode.

    letterSpacing?: number

    The spacing in whole pixels between characters.

    lineHeight?: number

    The line height used to render text.

    linkHandler?: ILinkHandler | null

    The handler for OSC 8 hyperlinks. Links will use the confirm browser API with a strongly worded warning if no link handler is set.

    When setting this, consider the security of users opening these links, at a minimum there should be a tooltip or a prompt when hovering or activating the link respectively. An example of what might be possible is a terminal app writing link in the form javascript:... that runs some javascript, a safe approach to prevent that is to validate the link starts with http(s)://.

    logger?: ILogger | null

    A logger to use instead of console.

    logLevel?: LogLevel

    What log level to use, this will log for all levels below and including what is set:

    1. trace
    2. debug
    3. info (default)
    4. warn
    5. error
    6. off
    macOptionClickForcesSelection?: boolean

    Whether holding a modifier key will force normal selection behavior, regardless of whether the terminal is in mouse events mode. This will also prevent mouse events from being emitted by the terminal. For example, this allows you to use xterm.js' regular selection inside tmux with mouse mode enabled.

    macOptionIsMeta?: boolean

    Whether to treat option as the meta key.

    minimumContrastRatio?: number

    The minimum contrast ratio for text in the terminal, setting this will change the foreground color dynamically depending on whether the contrast ratio is met. Example values:

    • 1: The default, do nothing.
    • 4.5: Minimum for WCAG AA compliance.
    • 7: Minimum for WCAG AAA compliance.
    • 21: White on black or black on white.
    overviewRuler?: IOverviewRulerOptions

    Controls the visibility and style of the overview ruler which visualizes decorations underneath the scroll bar.

    reflowCursorLine?: boolean

    Whether to reflow the line containing the cursor when the terminal is resized. Defaults to false, because shells usually handle this themselves.

    rescaleOverlappingGlyphs?: boolean

    Whether to rescale glyphs horizontally that are a single cell wide but have glyphs that would overlap following cell(s). This typically happens for ambiguous width characters (eg. the roman numeral characters U+2160+) which aren't featured in monospace fonts. This is an important feature for achieving GB18030 compliance.

    The following glyphs will never be rescaled:

    • Emoji glyphs
    • Powerline glyphs
    • Nerd font glyphs

    Note that this doesn't work with the DOM renderer. The default is false.

    rightClickSelectsWord?: boolean

    Whether to select the word under the cursor on right click, this is standard behavior in a lot of macOS applications.

    screenReaderMode?: boolean

    Whether screen reader support is enabled. When on this will expose supporting elements in the DOM to support NVDA on Windows and VoiceOver on macOS.

    scrollback?: number

    The amount of scrollback in the terminal. Scrollback is the amount of rows that are retained when lines are scrolled beyond the initial viewport. Defaults to 1000.

    scrollOnEraseInDisplay?: boolean

    If enabled the Erase in Display All (ED2) escape sequence will push erased text to scrollback, instead of clearing only the viewport portion. This emulates PuTTY's default clear screen behavior.

    scrollOnUserInput?: boolean

    Whether to scroll to the bottom whenever there is some user input. The default is true.

    scrollSensitivity?: number

    The scrolling speed multiplier used for adjusting normal scrolling speed.

    smoothScrollDuration?: number

    The duration to smoothly scroll between the origin and the target in milliseconds. Set to 0 to disable smooth scrolling and scroll instantly.

    tabStopWidth?: number

    The size of tab stops in the terminal.

    theme?: ITheme

    The color theme of the terminal.

    windowOptions?: IWindowOptions

    Enable various window manipulation and report features. All features are disabled by default for security reasons.

    windowsPty?: IWindowsPty

    Compatibility information when the pty is known to be hosted on Windows. Setting this will turn on certain heuristics/workarounds depending on the values:

    • if (backend !== undefined || buildNumber !== undefined)
      • When increasing the rows in the terminal, the amount increased into the scrollback. This is done because ConPTY does not behave like expect scrollback to come back into the viewport, instead it makes empty rows at of the viewport. Not having this behavior can result in missing data as the rows get replaced.
    • if !(backend === 'conpty' && buildNumber >= 21376)
      • Reflow is disabled
      • Lines are assumed to be wrapped if the last character of the line is not whitespace.
    wordSeparator?: string

    A string containing all characters that are considered word separated by the double click to select work logic.