Skip to content

Only launch pty host when it's actually needed #182637

@Tyriar

Description

@Tyriar

After #182631, we launch the pty host off the main process (or server) as soon as a window asks for a connection. The window connection will always happen after LifecyclePhase.Restored but we could push this even further by only launching the pty host when it's needed.

Currently we pre-emptively fetch terminal profiles but we could change that to happen on demand, meaning if you loaded VS Code without the terminal showing, and then ran the open terminal with profile command, it would be slightly delayed as it needs to wait for the pty host to load up as profiles are evaluated there. The benefits of this are:

  • Less work on startup (even if it's after restored)
  • ~40mb less constant memory used by the pty host if you don't use the terminal
  • We'd want to do this anyway if we wanted to lazy load the entire terminal contrib which has been an idea we've thrown around a little in the past

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code Insiderson-testplanperfterminal-processProblems launching processes, managing ptys, exiting, process leaks, etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions