anthropics / anthropics/claude-code

Desktop (Windows): code block Run opens a new terminal tab instead of the existing terminal with an ssh session

Aperta
#94,259 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:desktop bug has repro platform:windows regression
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

### 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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
bash, powershell, shell
Ambito
cli, desktop
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.