Skip to content

VS Code on M5 Pro Macbook Pro crashes with error: The window terminated unexpectedly (reason: ‘crashed’, code: ‘5’) #312883

@rohit901

Description

@rohit901

Type: Performance Issue

Similar to #266324, the VS Code window crashes after 1-2 mins of opening my home folder (~) in my macbook and I get the error: “The window terminated unexpectedly (reason: ‘crashed’, code: ‘5’)”. I just run the command code . from "~" directory only to see that the CPU/GPU temp rises pretty quickly, the fans in my Macbook Pro start running and the VS Code window crashes soon with the error:

Image

Although I also have a remote ssh session running, this issue happens in my local macbook machine.
The CPU/GPU cores also become very hot:

Image

I was not having this issue earlier in VS Code. I recently updated my VS Code version, and also changed my settings.json file. I don't remember what version of VS Code I had earlier.

My current settings.json file looks like this:

{
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter-notebook"
    },
    "terminal.external.osxExec": "iTerm.app",
    "terminal.integrated.fontFamily": "MesloLGS NF",
    "notebook.cellToolbarLocation": {
        "default": "right",
        "jupyter-notebook": "left"
    },
    "markdown.preview.fontSize": 17,
    "editor.inlineSuggest.enabled": true,
    "explorer.confirmDelete": true,
    "workbench.iconTheme": "material-icon-theme",
    "workbench.colorTheme": "One Dark Pro Night Flat",
    "editor.formatOnSaveMode": "file",
    "git.terminalAuthentication": false,
    "[python]": {
        "editor.formatOnType": true,
        "editor.formatOnSave": true,
        "editor.defaultFormatter": "charliermarsh.ruff",
        "editor.codeActionsOnSave": {
            "source.fixAll.ruff": "explicit",
            "source.organizeImports.ruff": "explicit"
        }
    },
    "notebook.output.scrolling": true,
    "workbench.startupEditor": "none",
    "editor.stickyScroll.enabled": true,
    "editor.stickyScroll.maxLineCount": 3,
    "explorer.decorations.badges": false,
    "claudeCode.preferredLocation": "panel",
    "remote.defaultExtensionsIfInstalledLocally": [
        "anthropic.claude-code"
    ],

    // ─── Font & Display ──────────────────────────────────────────────────────────
    "editor.fontSize": 14,
    "editor.lineHeight": 22,
    "editor.fontFamily": "JetBrains Mono, Menlo, monospace",
    "editor.fontWeight": "400",
    "editor.fontLigatures": false,                         // ← changed: was true (HarfBuzz mitigation)
    "terminal.integrated.fontSize": 13,
    "debug.console.fontSize": 13,

    // ─── Editor UX ───────────────────────────────────────────────────────────────
    "editor.minimap.enabled": false,
    "editor.rulers": [88],
    "editor.bracketPairColorization.enabled": true,
    "editor.guides.bracketPairs": true,                    // ← changed: was "active" (less repainting)
    "editor.guides.indentation": true,
    "editor.renderWhitespace": "boundary",
    "editor.smoothScrolling": true,
    "editor.cursorBlinking": "blink",                      // ← changed: was "phase" (simpler animation)
    "editor.cursorSmoothCaretAnimation": "off",            // ← changed: was "on" (reduces redraw frequency)
    "editor.scrollbar.verticalScrollbarSize": 6,

    // ─── Notebook ────────────────────────────────────────────────────────────────
    "notebook.lineNumbers": "on",

    // ─── Pylance inlay hints (useful for complex tensor type flows) ───────────────
    "python.analysis.inlayHints.functionReturnTypes": false,
    "python.analysis.inlayHints.variableTypes": false,
    "python.analysis.inlayHints.callArgumentNames": "partial",
    "python.analysis.diagnosticMode": "openFilesOnly",
    "python.analysis.indexing": true,
    "python.analysis.autoImportCompletions": true,

    // ─── Workbench color tweaks for Night Flat ────────────────────────────────────
    "workbench.colorCustomizations": {
        "[One Dark Pro Night Flat]": {
            "tab.activeBackground": "#21252b",
            "tab.inactiveBackground": "#21252b",
            "tab.activeBorder": "#61afef",
            "activityBar.background": "#21252b",
            "sideBar.background": "#21252b",
            "editor.lineHighlightBackground": "#2c313c",
            "editor.lineHighlightBorder": "#00000000",
            "editorIndentGuide.background1": "#3b4048",
            "editorIndentGuide.activeBackground1": "#636d83",
            "editorBracketHighlight.foreground1": "#d19a66",
            "editorBracketHighlight.foreground2": "#c678dd",
            "editorBracketHighlight.foreground3": "#56b6c2",
            "editorBracketHighlight.foreground4": "#e5c07b",
            "scrollbarSlider.background": "#4b526680",
            "scrollbarSlider.hoverBackground": "#636d8399"
        }
    },

    // ─── Semantic token colors for Python/Pylance ─────────────────────────────────
    "editor.semanticTokenColorCustomizations": {
        "[One Dark Pro Night Flat]": {
            "enabled": true,
            "rules": {
                "selfParameter:python": "#e06c75",
                "clsParameter:python": "#e06c75",
                "magicFunction:python": "#56b6c2",
                "function.declaration:python": "#61afef",
                "*.decorator:python": "#c678dd",
                "*.typeHint:python": "#e5c07b",
                "*.typeHintComment:python": "#7f848e",
                "parameter:python": "#d19a66",
                "class:python": "#e5c07b",
                "enumMember:python": "#56b6c2"
            }
        }
    },

    // ─── Italic styling (comments + control flow keywords) ───────────────────────
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "name": "Italics: comments + keywords",
                "scope": [
                    "comment",
                    "punctuation.definition.comment",
                    "keyword.control",
                    "keyword.control.flow",
                    "keyword.control.import",
                    "keyword.control.conditional",
                    "keyword.control.trycatch",
                    "storage.type.function",
                    "storage.modifier.async"
                ],
                "settings": {
                    "fontStyle": "italic"
                }
            }
        ]
    },

    "files.trimTrailingWhitespace": true,
    "files.insertFinalNewline": true,

    "python.analysis.typeCheckingMode": "basic",
    "editor.inlineSuggest.suppressSuggestions": false,
    "window.zoomLevel": 0,
    "files.exclude": {
        "**/__pycache__": true,
        "**/.pytest_cache": true,
        "**/.mypy_cache": true,
        "**/.ruff_cache": true,
        "**/.ipynb_checkpoints": true
    },

    "search.exclude": {
        "**/wandb": true,
        "**/runs": true,
        "**/outputs": true,
        "**/checkpoints": true,
        "**/logs": true,
        "**/data": true,
        "**/datasets": true,
        "**/.git": true,
        "**/.venv": true,
        "**/venv": true
    },

    "files.watcherExclude": {
        "**/wandb/**": true,
        "**/runs/**": true,
        "**/outputs/**": true,
        "**/checkpoints/**": true,
        "**/logs/**": true,
        "**/data/**": true,
        "**/datasets/**": true,
        "**/.git/objects/**": true,
        "**/.git/subtree-cache/**": true,
        "**/.venv/**": true,
        "**/venv/**": true
    },
    "terminal.integrated.scrollback": 10000,               // ← changed: was 50000 (caps in-memory text buffer)
    "notebook.diff.ignoreMetadata": true,
    "notebook.diff.ignoreOutputs": true,
    "notebook.formatOnSave.enabled": true,
    "notebook.codeActionsOnSave": {
        "notebook.source.fixAll": "explicit",
        "notebook.source.organizeImports": "explicit"
    },
    "jupyter.askForKernelRestart": false,
    "files.autoSave": "onFocusChange",
    "git.autofetch": true,
    "git.confirmSync": false,
    "editor.formatOnPaste": false,
    "editor.suggest.preview": true,
    "editor.acceptSuggestionOnEnter": "off",
    "diffEditor.ignoreTrimWhitespace": false,
    "python.terminal.activateEnvironment": true,
    "notebook.markup.fontSize": 14,
    "files.associations": {
        "*.cu": "cpp",
        "*.cuh": "cpp"
    },
    "remote.SSH.connectTimeout": 60,
    "remote.SSH.useLocalServer": true,
    "remote.SSH.lockfilesInTmp": true,
    "ruff.nativeServer": "on",
    "ruff.lineLength": 88,
    "ruff.organizeImports": true,
    "ruff.fixAll": true,
    "ruff.codeAction.disableRuleComment": {
        "enable": false
    }
}

VS Code version: Code 1.117.0 (10c8e55, 2026-04-21T16:12:14-07:00)
OS version: Darwin arm64 25.4.0
Modes:
Remote OS version: Linux x64 6.8.0-90-generic

System Info
Item Value
CPUs Apple M5 Pro (15 x 2400)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x106b [Google Inc. (Apple)], DEVICE=0x0000 [ANGLE (Apple, ANGLE Metal Renderer: Apple M5 Pro, Version 26.4.1 (Build 25E253))], DRIVER_VENDOR=Apple, DRIVER_VERSION=26.4.1 ACTIVE
Machine model name: Mac
Machine model version: 17.9
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 19, 7, 4
Memory (System) 24.00GB (0.16GB free)
Process Argv . --crash-reporter-id 4034eee4-d2bd-4bd5-ae7f-eafa2c7f4040
Screen Reader no
VM 0%
Item Value
Remote SSH: vico06
OS Linux x64 6.8.0-90-generic
CPUs AMD EPYC 7713 64-Core Processor (256 x 3693)
Memory (System) 1007.64GB (538.21GB free)
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    2	56998682784	 57287	code
    0	18999560928	 57290	   gpu-process
    0	12666373952	 57291	   utility-network-service
    2	37999121856	 57293	shared-process
    0	     0	 67425	     /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	18999560928	 57314	pty-host
    0	     0	 63487	     /bin/zsh -i
    0	     0	 65903	     /bin/zsh -i
    0	     0	 66675	     /bin/zsh -i
    0	44332308832	 57989	window [2] (SMCReader.py — dna-rendering (Workspace) [SSH: vico06])
    0	18999560928	 61999	extension-host [2]
    0	12666373952	 62009	     electron-nodejs (localServer.js)
    0	     0	 62018	       ssh -v -T -D 50511 -o ConnectTimeout=60 vico06
    0	12666373952	 62024	file-watcher [2]
  182	683984193407	 66660	window [8] (argv.json — rohit)
    0	25332747904	 66661	file-watcher [8]
   33	398990779487	 66662	extension-host [8]
    0	18999560928	 66663	     /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=66662
    0	6333186976	 66667	     /Users/rohit/.vscode/extensions/ms-python.vscode-python-envs-1.28.0-darwin-arm64/python-env-tools/bin/pet server
    0	12666373952	 66778	     /Users/rohit/.vscode/extensions/openai.chatgpt-26.422.30944-darwin-arm64/bin/macos-aarch64/codex app-server --analytics-default-enabled
   28	234327918112	 66989	     electron-nodejs (bundle.js)
    0	     0	 67386	       <defunct>
    0	     0	 67394	       <defunct>
    0	     0	 67395	       <defunct>
  441	31665934880	 67403	     /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules/@vscode/ripgrep/bin/rg --files --hidden --case-sensitive --no-require-git -g !**/.git -g !**/.svn -g !**/.hg -g !**/.DS_Store -g !**/Thumbs.db -g !**/__pycache__ -g !**/.pytest_cache -g !**/.mypy_cache -g !**/.ruff_cache -g !**/.ipynb_checkpoints -g !**/node_modules -g !**/bower_components -g !**/*.code-search -g !**/wandb -g !**/runs -g !**/outputs -g !**/checkpoints -g !**/logs -g !**/data -g !**/datasets -g !**/.venv -g !**/venv --no-ignore-parent --follow --no-config --no-ignore-global
  525	6333186976	 67422	     /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules/@vscode/ripgrep/bin/rg --files --hidden --case-sensitive --no-require-git -g /.vscode/argv.json -g !**/.git -g !**/.svn -g !**/.hg -g !**/.DS_Store -g !**/Thumbs.db -g !**/__pycache__ -g !**/.pytest_cache -g !**/.mypy_cache -g !**/.ruff_cache -g !**/.ipynb_checkpoints -g !/{**/node_modules,**/bower_components,**/*.code-search,**/wandb,**/runs,**/outputs,**/checkpoints,**/logs,**/data,**/datasets,**/.git,**/.venv,**/venv,**/.git,**/.svn,**/.hg,**/.DS_Store,**/Thumbs.db,**/__pycache__,**/.pytest_cache,**/.mypy_cache,**/.ruff_cache,**/.ipynb_checkpoints,**/**/.claude/settings.local.json} --no-ignore --follow --no-config --no-ignore-global

Remote: SSH: vico06
CPU %	Mem MB	   PID	Process
    0	     0	2840262	remote-server
    0	     0	2840338	   ptyHost
    0	     0	2842046	     /bin/bash --init-file /disk/scratch/rohit/.vscode-server/cli/servers/Stable-10c8e557c8b9f9ed0a87f61f1c9a44bde731c409/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
    0	     0	2843317	     /bin/bash --init-file /disk/scratch/rohit/.vscode-server/cli/servers/Stable-10c8e557c8b9f9ed0a87f61f1c9a44bde731c409/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
    0	     0	2871196	     /bin/bash --init-file /disk/scratch/rohit/.vscode-server/cli/servers/Stable-10c8e557c8b9f9ed0a87f61f1c9a44bde731c409/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
    0	     0	2872006	     /bin/bash --init-file /disk/scratch/rohit/.vscode-server/cli/servers/Stable-10c8e557c8b9f9ed0a87f61f1c9a44bde731c409/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
    0	     0	2871148	   extension-host
    0	     0	2871220	     /disk/scratch/rohit/.vscode-server/extensions/ms-python.vscode-python-envs-1.28.0-linux-x64/python-env-tools/bin/pet server
    0	265900107277	2872165	     /disk/scratch/rohit/.vscode-server/cli/servers/Stable-10c8e557c8b9f9ed0a87f61f1c9a44bde731c409/server/node /disk/scratch/rohit/.vscode-server/extensions/ms-python.vscode-pylance-2026.2.1/dist/server.bundle.js --cancellationReceive=file:67c3eb4b620564831a477a08259e9a8b138a2c1db6 --node-ipc --clientProcessId=2871148
    0	     0	2880510	       [python] <defunct>
    0	     0	2880511	       [python] <defunct>
    0	     0	2874175	     /disk/scratch/rohit/.vscode-server/cli/servers/Stable-10c8e557c8b9f9ed0a87f61f1c9a44bde731c409/server/node /disk/scratch/rohit/.vscode-server/cli/servers/Stable-10c8e557c8b9f9ed0a87f61f1c9a44bde731c409/server/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=2871148
    0	     0	2871160	   fileWatcher
    0	     0	2885691	   /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
Workspace Info
|  Window (argv.json — rohit)
|    Folder (rohit): more than 21315 files
|      File types: py(4139) pyc(3524) json(3171) pyi(321) h(320) md(239)
|                  tcl(149) msg(147) so(86) txt(83)
|      Conf files: package.json(5) claude.md(3) makefile(1) settings.json(1)
|                  claude-settings(1) claude-settings-local(1)
|  Remote: SSH: vico06;
Extensions (18)
Extension Author (truncated) Version
copilot-chat Git 0.45.1
claude-code Ant 2.1.120
ruff cha 2026.40.0
debugpy ms- 2025.18.0
python ms- 2026.4.0
vscode-pylance ms- 2026.2.1
vscode-python-envs ms- 1.28.0
jupyter ms- 2025.9.1
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-ssh ms- 0.122.0
remote-ssh-edit ms- 0.87.0
remote-explorer ms- 0.5.0
chatgpt ope 26.422.30944
material-icon-theme PKi 5.34.0
material-theme zhu 3.19.0
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
b6b4d950:31327385
6abeh943:31336334
envsactivate1:31464700
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ec5jj548:31422691
cp_cls_t_966_ss:31454198
a9239246:31499107
8hhj4413:31478653
38bie571_auto:31429954
cp_cls_c_1081:31454833
conptydll_true:31498968
ia-use-proxy-models-svc:31452481
e9c30283:31461165
test_treatment2:31471001
46204921:31447328
control_6dc23131:31497324
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
534a6447:31496642
hg17d649:31458077
nes-extended-on:31455476
chat:31457767
8hig5102:31480529
89g7j272:31500881
7e187181:31503455
cpptoolson-v2:31475363
i2gc6536:31499202
githubstableflight:31469463
1g3cj959:31501677
ghj88844:31499326
23c7c724:31491644
client_tst_t:31495907
ddid_t:31478206
1b2f8594:31502054
getcmakediagnosticsoff:31489825
pro_large_t:31499376
cp_cls_c_1082:31491634
719di409_sum_t:31499347
nes-cj-aftline:31500937
logging_enabled_new:31498466
db5d2638:31499441
nes-dist-check-on:31503267
56dj4588:31497896
nes-revagr-0:31501786

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions