Skip to content

Conversation

@SimonSiefke
Copy link
Contributor

Fixes a memory leak in terminal editor by removing the focus listener when clearInput is called.

Before

When moving a terminal from panel to editor area 97 times, a function seems to be created each time at terminalEditor.ts:87:64 which is never removed.

{
  "namedFunctionCount3": [
    {
      "count": 99,
      "delta": 97,
      "name": "anonymous",
      "sourceLocation": "out/vs/workbench/workbench.desktop.main.js:2841:56564",
      "originalLocation": "src/vs/workbench/contrib/terminal/browser/terminalEditor.ts:87:64",
      "originalName": "TerminalEditor.setInput"
    }
  ],
  "isLeak": true
}

After

No more leak is detected.

{
  "namedFunctionCount3": [],
  "isLeak": false
}

Copy link
Contributor

@meganrogge meganrogge left a comment

Choose a reason for hiding this comment

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

Thank you!

@meganrogge meganrogge added this to the December / January 2026 milestone Dec 16, 2025
@meganrogge meganrogge enabled auto-merge (squash) December 16, 2025 19:40
@meganrogge meganrogge merged commit c843a8a into microsoft:main Dec 19, 2025
17 checks passed
@SimonSiefke SimonSiefke deleted the fix/memory-leak-terminal-editor branch January 15, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants