anthropics / anthropics/claude-code
Desktop (Windows): code block Run opens a new terminal tab instead of the existing terminal with an ssh session
- Langage dominant
- Python
- Étoiles
- 145k
- Forks
- 23.1k
- Métriques de merge des PR
- Métriques de PR en attente
Description
### Summary
Claude desktop (Windows), Code tab: pressing **Run** on a ```bash code block opens a **new terminal tab** instead of writing the command into the session's existing terminal, where an interactive `ssh` session is open. Until the 2026-09-14 update Run always wrote into the existing terminal.
### Environment
- Claude desktop 1.52386.6.0 (MSIX), Windows 11 Pro 10.0.26200
- Claude Code 2.1.270 (updated from 2.1.266 on 2026-09-14)
### Steps to reproduce
1. Open a Code session and its terminal panel (terminal 1).
2. In terminal 1 start an interactive `ssh ` session.
3. In the chat, press **Run** on any ```bash code block.
### Expected
The command is written into terminal 1 (the ssh session), as before the update.
### Actual
A new terminal tab is spawned and the command runs locally in PowerShell. `main.log` shows a new PTY per click:
```
2026-09-14 13:10:44 LocalSessions.startShellPty: sessionId=local_…::1
2026-09-14 13:21:39 LocalSessions.startShellPty: sessionId=local_…::2
2026-09-14 13:21:45 LocalSessions.startShellPty: sessionId=local_…::3
2026-09-14 13:24:02 LocalSessions.startShellPty: sessionId=local_…::4
2026-09-14 13:30:12 LocalSessions.startShellPty: sessionId=local_…::5
2026-09-14 14:07:04 LocalSessions.startShellPty: sessionId=local_…::8
```
- Right after a full app restart (tray → Exit), Run writes into terminal 1 again (13:56).
- After ~5–10 minutes without terminal output, Run spawns a new tab again (14:07). No session switch happened in between (no `setFocusedSession` in the log).
- Pressing Enter in terminal 1 before Run (to produce output) does not help.
- In the prior month such extra tabs appeared 3 times; on 2026-09-14 — 8 times.
### Notes from the local bundle
In `app/resources/ion-dist/assets/v1/c11959232-*.js`, `run` writes directly only when `isPrimaryTarget && ptyReady`, where `ptyReady = && !`; on Windows `getBusyShellPtyKeys` returns `{busy: [], probed: false}`. The live interface is loaded from `assets-proxy.anthropic.com` and may differ from the local copy. Something resets the ready state after a period of inactivity.
### Impact
Running remote commands via Run inside an open ssh session is no longer possible; every click spawns a local terminal that has to be closed.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Reproduce the issue on Windows by opening an ssh session, waiting through the inactivity period, and pressing Run on a bash block. Inspect main.log and app/resources/ion-dist/assets/v1/c11959232-*.js, focusing on LocalSessions.startShellPty and the isPrimaryTarget/ptyReady behavior. Done means Run continues writing to the existing terminal and does not spawn a new local PowerShell tab after inactivity.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- bash, powershell, shell
- Domaine
- cli, desktop
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100