Skip to content

expose API method for writing to application side #4948

@jerch

Description

@jerch

Coming from #4220 and this comment #4220 (comment)

It would be nice to have a method to write to application side from xterm.js' API. Internally xterm.js uses this.coreService.triggerDataEvent for this, which can easily be exposed at the API as well.

interface suggestion

  export class Terminal implements IDisposable {
    ...
    /**
     * Input data to application side.
     * The data is treated the same way as typed input at the terminal (will appear in the onData event).
     */
    input(data: string): void;
    ...
}

Such a method would help to automate data input programmatically, e.g. from the clipboard addon w'o hooking into hidden internals.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions