anthropics / anthropics/claude-code

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

Abierto
#94,259 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:desktop bug has repro platform:windows regression
Lenguaje dominante
Python
Estrellas
145k
Forks
23.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
bash, powershell, shell
Área
cli, desktop
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.