Skip to content

Uninstall deferred event handlers after the pty is ready #215

Description

@Tyriar

In WindowsTerminal there are ['connect', 'data', 'end', 'timeout', 'drain'] event listeners which handle event handler deferreds, we should uninstall these handlers after it's ready. This would reduce the amount of code that is run when a data event is triggered.

Activity

  1. gpetrov commented on Sep 7, 2020

    @gpetrov

    Daniel Imms (@Tyriar) Please reconsider also how you set the ready state ... now isReady is only set on the first data event, however I just had a case when no output data was send and the command just ends. So the 'exit' is fired without any data. This is a valid case.

    However now you can't destroy the terminal or kill it, as the deferreds are still in place waiting for the ready state ... which never comes.

    Maybe be also destroy and kill shouldn't really be using deferreds and just kill the whole thing. Or add a timeout parameter to destroy/kill anyway after a specific time - no matter if command is running.

  2. added
    debtCode quality issues
    bugIssue identified by VS Code Team member as probable bug
    and removed
    bugIssue identified by VS Code Team member as probable bug
    on Dec 19, 2025
  3. added this to the milestone on Dec 19, 2025
  4. Tyriar commented on Dec 19, 2025

    @Tyriar
    ContributorAuthor

    George Petrov (@gpetrov) that one's tracked in #72, this is mainly tracking just a clean up/minor perf improvement.

  5. added a commit that references this issue on Dec 19, 2025
    8305f06
  6. added a commit that references this issue on Aug 31, 2026
    888f391
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugdebtCode quality issueswindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions