Repository navigation
Description
Does this issue occur when all extensions are disabled?: TBD
- VS Code Version:
Version: 1.78.1
Commit: 6a995c4f4cc2ced6e3237749973982e751cb0bf9
Date: 2023-05-04T10:01:22.349Z (1 wk ago)
Electron: 22.5.1
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: No
- OS Version:
macOS 13.3.1 (a) (22E772610a)
Steps to Reproduce:
I've had this happen twice now, once today and last time was on May 5th.
I try to connect to my remote session and I get this:
I try to jump into my macOS terminal, which I typically always have open anyway and run some commands, ssh works fine of course, perplexed... I wound up trying to open a new tab with a new terminal and it fails...
After much digging I find this:
% lsof | grep /dev/ptmx | grep Code | wc -l
510
vscode is using all of my available TTY fd's.
This happened in the course of 2 days (I rebooted the machine 2 days ago).
It is worth noting right now I have 3 vscode windows open, all disconnected from the remote.
Closing all vscode windows (but with the vscode process still running as happens on macOS until you cmd+q it) does not change this number.
Actually quitting vscode gives me all my tty fd's back.
(let's assume from now on when I say fd I'm referring to /dev/ptmx fd's)
On a brand new vscode instance (no remote connection or anything), just a window open there are 0 open fd's from vscode.
Opening one terminal in vscode there are now 2 fd's opened.
After closing that terminal there is 1 fd open.
Opening a new terminal there are 3 fd's open.
Closing that terminal there are 2 fd's open now.
Open a new terminal and there are now 4 fd's (seeing a pattern here).
Opening a 2nd terminal there are 6 fd's open.
Close that 2nd terminal 5 fd's.
Connect to a remote, which automatically opens a new terminal, 8 fd's.
Close the remote terminal, still 8 fd's open.
Open a new remote terminal, still 8 fd's open (some re-use here?)
Open 3 more remote terminals, still 8 fd's open.
Go back to the original local window and open a remote project, 10 fd's open. (seems remote's share the same local fd's between terminals in one window)
Close that window, create a new window and open the same remote project, 13 fd's open.
Closing all open windows (but keeping vscode running) still 13 fd's open
Open a new window connected to the same remote+project, 16 fd's open.
Based on this pattern it looks like:
- Local terminals leak 1 fd per terminal after closing
- Remote terminals share the same 2 local fd's for all terminals in one window
- New windows connected to the same remote get new fd's
- fd's attached to remote terminals are never closed until vscode as a whole is closed.
Activity
Tyriar commentedon May 12, 2023
Reported in the past here: #58814
Robo (@deepak1556) + Raymond Zhao (@rzhao271) you might know how to fix this?
cpuguy83 commentedon May 12, 2023
I logged in this morning to find all my TTY fd's used up again.
I definitely did not have anywhere close to that much churn yesterday, so it seems like there's something else at play in vscode.
Maybe something related to disconnected remote sessions?
deepak1556 commentedon May 13, 2023
This might be a regression from microsoft/node-pty#589, will investigate.
18 remaining items
RblSb commentedon Dec 19, 2023
Still not fixed. Every build task run on macos allocates new virtual terminal, after day of build runs you will need to restart vscode. Very annoying.

Robo (@deepak1556) please, at least add
regressiontag and removeconfirmation-pendingif you can repro this:echo.zip
deepak1556 commentedon Jan 29, 2026
Steps for verification
lsof | grep /dev/ptmx | grep Code | wc -lis 0lsof | grep /dev/ptmx | grep Code | wc -land it should be non-zerolsof | grep /dev/ptmx | grep Code | wc -lis 0