Skip to content

Refactor terminal launch logic to defer process creation until after the container is ready and measured #106672

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

Closed
Tyriar opened this issue Sep 14, 2020 · 2 comments
Assignees
Labels
debt Code quality issues terminal General terminal issues that don't fall under another label
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2020

Right now the basic process for launching terminals is:

Create terminal instance
Create xterm.js instance
Create pty with 80x30 dimensions
Attach xterm.js to the DOM
Resize pty to correct dimensions

This causes a bunch of problems like:

Proposal to fix these problems:

Create terminal instance
Create xterm.js instance
If the terminal is backgrounded
  Create pty with last known dimensions, fall back to 80x30
Else
  Allow 500ms for the terminal to be attached to the DOM
    Attach xterm.js to the DOM
    Create pty with correct dimensions
  If 500ms elapses
    Create pty with last known dimensions, fall back to 80x30

This should create terminals with the correct dimensions much more often while still keeping backgrounded terminals launching asap. The 500ms case shouldn't happen in practice but it's possible if the main thread is really busy or something.

@Tyriar Tyriar added debt Code quality issues terminal General terminal issues that don't fall under another label labels Sep 14, 2020
@Tyriar Tyriar self-assigned this Sep 14, 2020
@Tyriar Tyriar added this to the October 2020 milestone Sep 14, 2020
@Tyriar Tyriar closed this as completed in 91bac85 Sep 14, 2020
@alexr00
Copy link
Member

alexr00 commented Oct 2, 2020

Looks like this was accidentally closed.

@alexr00 alexr00 reopened this Oct 2, 2020
@Tyriar Tyriar modified the milestones: October 2020, November 2020 Oct 27, 2020
@Tyriar Tyriar modified the milestones: January 2021, Backlog Jan 25, 2021
@Tyriar
Copy link
Member Author

Tyriar commented Oct 12, 2021

Lots of changes have happened around this code since this was opened.

@Tyriar Tyriar closed this as completed Oct 12, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

4 participants
@Tyriar @lszomoru @alexr00 and others