microsoft / microsoft/vscode

Integrated terminal enters inconsistent state after restart: "Restart Terminal" warnings, xterm.js Cannot read properties of undefined (reading 'dimensions'), terminal shortcuts intermittently stop working

Open
#324,200 0 comments 0 reactions 1 assignee Claimed by @anthonykim1 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### VS Code Version

Version: 1.127.0 (also reproduced on 1.126.0)

### OS

Windows 11 Home Single Language
Version 25H2
Build 26200.8655

### Extensions

Only Microsoft Python extensions:

- ms-python.python
- ms-python.debugpy
- ms-python.vscode-pylance
- ms-python.vscode-python-envs

Issue also occurred with GitHub Copilot enabled previously.

---

## Reproduction

1. Open a Python project with a local venv.
2. Open the integrated terminal.
3. Close VS Code.
4. Reopen VS Code.
5. After reopening, the integrated terminal frequently enters a bad state.

---

## Symptoms

- The terminal status shows a yellow warning icon.
- VS Code repeatedly asks to restart the terminal because extensions want to modify the terminal environment.
- The extension mentioned changes between sessions (Python Debugger, Copilot, etc.).
- Python virtual environment activation becomes inconsistent.
- Terminal keyboard shortcuts intermittently stop working (Ctrl+C, Ctrl+V, Ctrl+A, Ctrl+S).
- Sometimes Ctrl combinations are passed directly to the shell (e.g. `^A`) instead of being handled by VS Code.
- Creating a new terminal sometimes fixes the issue temporarily.

---

## What I already tested

- Clean VS Code profile (`--user-data-dir`)
- Reinstalled VS Code
- Deleted User/globalStorage/workspaceStorage
- Disabled shell integration
- Disabled persistent terminal sessions
- Downgraded VS Code to 1.126.0
- Downgraded Python extensions by several months

Downgrading Python extensions removes the persistent "Restart Terminal" warning, but the terminal keyboard issues still occur.

---

## Developer Console

The following error consistently appears:

```text
Cannot read properties of undefined (reading 'dimensions')

at get dimensions
@xterm/xterm/lib/xterm.js
...
```

Later another error appears:

```text
InstantiationService has been disposed
```

---

## Additional observations

Keyboard shortcut troubleshooting shows that VS Code successfully resolves shortcuts such as Ctrl+C and invokes the expected commands, yet the integrated terminal still behaves incorrectly afterwards.

This makes it look like the terminal frontend (xterm.js) enters an invalid state after window/session restoration.

Log:
2026-07-03 13:56:28.383 [error] [Окно] Cannot read properties of undefined (reading 'dimensions'): TypeError: Cannot read properties of undefined (reading 'dimensions')
at get dimensions (vscode-file://vscode-app/c:/Users/Hotaro/AppData/Local/Programs/Microsoft%20VS%20Code/4fe60c8b1c/resources/app/node_modules/@xterm/xterm/lib/xterm.js:1:187310)
at _.scrollLines (vscode-file://vscode-app/c:/Users/Hotaro/AppData/Local/Programs/Microsoft%20VS%20Code/4fe60c8b1c/resources/app/node_modules/@xterm/xterm/lib/xterm.js:1:55299)
at F.scrollLines (vscode-file://vscode-app/c:/Users/Hotaro/AppData/Local/Programs/Microsoft%20VS%20Code/4fe60c8b1c/resources/app/node_modules/@xterm/xterm/lib/xterm.js:1:28719)
at F.scrollToBottom (vscode-file://vscode-app/c:/Users/Hotaro/AppData/Local/Programs/Microsoft%20VS%20Code/4fe60c8b1c/resources/app/node_modules/@xterm/xterm/lib/xterm.js:1:28991)
at v.scrollToBottom (vscode-file://vscode-app/c:/Users/Hotaro/AppData/Local/Programs/Microsoft%20VS%20Code/4fe60c8b1c/resources/app/node_modules/@xterm/xterm/lib/xterm.js:1:81099)
at FA.scrollToBottom (vscode-file://vscode-app/c:/Users/Hotaro/AppData/Local/Programs/Microsoft%20VS%20Code/4fe60c8b1c/resources/app/out/vs/workbench/workbench.desktop.main.js:3910:7162)
at cb.sendText (vscode-file://vscode-app/c:/Users/Hotaro/AppData/Local/Programs/Microsoft%20VS%20Code/4fe60c8b1c/resources/app/out/vs/workbench/workbench.desktop.main.js:4053:6491)
at async cb.runCommand (vscode-file://vscode-app/c:/Users/Hotaro/AppData/Local/Programs/Microsoft%20VS%20Code/4fe60c8b1c/resources/app/out/vs/workbench/workbench.desktop.main.js:4053:831)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.