anthropics / anthropics/claude-code
Desktop (Windows): code block Run opens a new terminal tab instead of the existing terminal with an ssh session
- Ngôn ngữ chính
- Python
- Star
- 145k
- Fork
- 23.1k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
### 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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- bash, powershell, shell
- Lĩnh vực
- cli, desktop
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100