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

Add IPtyHostService #187177

Merged
merged 3 commits into from
Jul 6, 2023
Merged

Add IPtyHostService #187177

merged 3 commits into from
Jul 6, 2023

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Jul 6, 2023

This is a new service which extends IPtyService and provides additional methods on the process that manages the connection to the pty host:

  • IPtyService: Talk to the pty host, this may be direct via a message port of via the main/server procs.
  • IPtyHostService: Talk to the pty host management interfaces on the main/server procs. These are no longer available as optional methods on IPtyService to be clear about where they happen (eg. getProfiles).

Fixes #186935

This is a new service which extends IPtyService and provides additional methods
on the process that manages the connection to the pty host:

- IPtyService: Talk to the pty host, this may be direct via a message port of via
  the main/server procs.
- IPtyHostService: Talk to the pty host management interfaces on the main/server
  procs. These are no longer available as optional methods on IPtyService to be
  clear about where they happen (eg. getProfiles).

Fixes #186935
@Tyriar Tyriar added this to the July 2023 milestone Jul 6, 2023
@Tyriar Tyriar requested a review from meganrogge July 6, 2023 18:45
@Tyriar Tyriar self-assigned this Jul 6, 2023
@Tyriar Tyriar enabled auto-merge July 6, 2023 18:46
case '$clearBuffer': return this._ptyService.clearBuffer.apply(this._ptyService, args);
case '$getInitialCwd': return this._ptyService.getInitialCwd.apply(this._ptyService, args);
case '$getCwd': return this._ptyService.getCwd.apply(this._ptyService, args);
case '$start': return this._ptyHostService.start.apply(this._ptyHostService, args);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still find this syntax a bit confusing - passing in the ptyHostService to it's function application... 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's binding the this variable inside the function, which you need to do when you use apply, otherwise it would be undefined.

@Tyriar Tyriar merged commit 57ae321 into main Jul 6, 2023
6 checks passed
@Tyriar Tyriar deleted the tyriar/186935 branch July 6, 2023 19:02
@github-actions github-actions bot locked and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce IPtyHostService
2 participants