xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.33k stars 1.61k forks source link

Expose API method for writing to application side (#4948) #4953

Closed arencoskun closed 6 months ago

arencoskun commented 6 months ago

This PR adds an input method which takes data as the parameter as described in the issue. If there are any issues, you can point it out and I'll fix it.

(Sorry if there's an issue, I am a beginner.)

Fixes #4948.

arencoskun commented 6 months ago

Thanks for the feedback, working on it

arencoskun commented 6 months ago

@arencoskun With fixing the remaining linter errors, this LGTM 👍

Oops, forgot to fix those. Will work on it in a few moments

jerch commented 6 months ago

@arencoskun ~The linter is still nagging about a whitespace in xterm.d.ts.~ (guess you were faster :smile_cat: )

Oh and btw - the declaration also needs to be added to xterm-headless.d.ts (sorry forgot about that before).

arencoskun commented 6 months ago

@arencoskun ~The linter is still nagging about a whitespace in xterm.d.ts.~ (guess you were faster 😸 )

Oh and btw - the declaration also needs to be added to xterm-headless.d.ts (sorry forgot about that before).

No problem, also adding that

arencoskun commented 6 months ago

Sorry, forgot to mark as draft

jerch commented 6 months ago

Whoopsie - the headless API-bundling class in src/headless/public/Terminal.ts would also need the impl forwarding similar to browser/public/Terminal.ts.

(Why? - We basically maintain 2 versions of xterm.js Terminal class - one for browser and for headless nodejs usage. So parts of the API bundling is doubled here.)

arencoskun commented 6 months ago

Whoopsie - the headless API-bundling class in src/headless/public/Terminal.ts would also need the impl forwarding similar to browser/public/Terminal.ts.

(Why? - We basically maintain 2 versions of xterm.js Terminal class - one for browser and for headless nodejs usage. So parts of the API bundling is doubled here.)

Thanks for the info, I've been busy tonight but most probably tomorrow I'll finish it off. (Also, seems like you can't mark PRs as drafts from the mobile app. That's weird 😀 )

jerch commented 6 months ago

@Tyriar Could you also review this PR? Because of the API addition I dont want to merge it w'o being reviewed by you.