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

expose API method for writing to application side #4948

Closed
jerch opened this issue Jan 29, 2024 · 2 comments · Fixed by #4953
Closed

expose API method for writing to application side #4948

jerch opened this issue Jan 29, 2024 · 2 comments · Fixed by #4953
Assignees
Labels
good first issue help wanted type/enhancement Features or improvements to existing features
Milestone

Comments

@jerch
Copy link
Member

jerch commented Jan 29, 2024

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.

@Tyriar
Copy link
Member

Tyriar commented Jan 29, 2024

I like it 👍

@jerch jerch changed the title expose API method for writing to appliation side expose API method for writing to application side Jan 29, 2024
@jerch
Copy link
Member Author

jerch commented Jan 29, 2024

@Tyriar I'd also need this for my proposal in #4943, but thats still at a very early stage... 😅

@jerch jerch added the type/enhancement Features or improvements to existing features label Jan 29, 2024
arencoskun added a commit to arencoskun/xterm.js that referenced this issue Feb 1, 2024
@jerch jerch added this to the 5.4.0 milestone Feb 1, 2024
jerch added a commit to jerch/xterm.js that referenced this issue Feb 1, 2024
@Tyriar Tyriar self-assigned this Feb 2, 2024
Tyriar added a commit that referenced this issue Feb 2, 2024
Expose API method for writing to application side (#4948)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants