API-provided terminal editor icon can be lost after restart
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
Steps to Reproduce:
1. Ensure `terminal.integrated.enablePersistentSessions` is enabled.
2. Using an isolated profile with a minimal extension, run a command that creates and shows a terminal with a distinctive built-in `ThemeIcon`:
```ts
const terminal = vscode.window.createTerminal({
name: 'Terminal icon persistence repro',
iconPath: new vscode.ThemeIcon('rocket'),
location: vscode.TerminalLocation.Editor
});
terminal.show();
```
The extension only creates the terminal when this command is invoked; it does not automatically recreate terminals on activation.
3. Confirm that the terminal editor tab displays the rocket icon.
4. Pin the terminal editor tab.
5. Open and select a normal text file, leaving the terminal tab open but inactive.
6. Fully exit VS Code and wait for the application to exit.
7. Relaunch the same VS Code build with the same profile and workspace.
8. Inspect the restored terminal tab before selecting it, then select it and wait for the shell prompt. The tab can display the default terminal icon instead of the rocket icon in both states.
Expected Behavior:
The restored terminal editor tab retains the `rocket` icon supplied through `TerminalOptions.iconPath`, both before selecting the tab and after the terminal is restored.
Actual Behavior:
After a full VS Code restart, the restored terminal editor tab can display the default terminal icon (`codicon-terminal`) instead of the API-provided rocket icon (`codicon-rocket`). Selecting the tab and waiting for the shell prompt does not restore the rocket icon.
The loss was observed both when restarting directly after creating a new terminal and when reloading the window before fully exiting and restarting. **Developer: Reload Window** alone retained the rocket icon, both before and after selecting the terminal tab.
The problem does not occur on every attempt: another isolated test profile retained the icon after restart. The additional condition that determines whether the icon is lost is not yet known.
VS Code version: Code - Insiders 1.137.0-insider (645f29cc3176500b4b5762ba887cf2a7f0ffdf2c)
OS version: Linux x64 6.18.33.2-microsoft-standard-WSL2
Modes: Linux desktop application running inside WSL, opening a local Linux folder (no Remote-WSL connection)
System Info
|Item|Value|
|---|---|
|OS|Ubuntu 24.04.4 LTS|
|Architecture|x64|
|Kernel|6.18.33.2-microsoft-standard-WSL2|
|Application|Linux desktop build, portable archive|
|Display|X11 (`DISPLAY=:0`)|
|Workspace|Local Linux folder|
|Profile|Isolated portable user data and extensions|
|Persistent sessions|`terminal.integrated.enablePersistentSessions: true`|
Extensions
The only added extension was the minimal reproduction extension, loaded through `--extensionDevelopmentPath`. Built-in extensions were included with the application.
Name|Identifier|Version
---|---|---
terminal-icon-repro|local.terminal-icon-repro|0.0.1
Contributor guide
Assessment
This issue has not been assessed yet.