anthropics / anthropics/claude-code

[BUG] Desktop: Run button not offered on powershell/pwsh/ps1 code blocks, though Run itself executes PowerShell on Windows

オープン 初心者向け
#92,872 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:desktop bug platform:windows
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

### Preflight Checklist

- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code

### What's Wrong?

In the desktop app's Code tab, the Run (▷) and send-to-terminal buttons on chat code blocks are gated on the fence language tag, and PowerShell tags are not on the allowlist. On Windows this is backwards: the Run button executes `powershell.exe` (see #89884), so a ```powershell block is the one block guaranteed to be valid for the target shell — and it is the only kind denied the button.

Tested one trivial command across seven fence tags in a single response:

| Fence tag | Run + terminal buttons |
|---|---|
| `bash` | yes |
| `sh` | yes |
| `shell` | yes |
| `powershell` | **no** (copy only) |
| `pwsh` | **no** (copy only) |
| `ps1` | **no** (copy only) |
| *(none)* | no (copy only) |

The practical effect is that on a Windows machine the model has to mislabel PowerShell commands as ```bash to make them runnable, or wrap them as `powershell -Command "..."` inside a bash fence. Both are worse than tagging them correctly.

### What Should Happen?

Add `powershell`, `pwsh`, and `ps1` to the set of fence tags that get the Run button.

Ideally the fence language would also pick the shell (route `bash` to Git Bash where available, `powershell`/`pwsh` to PowerShell) — that is item 2 of #89884's proposed fixes. But even without shell routing, allowlisting the PowerShell tags is strictly an improvement on Windows, where the button already lands in PowerShell.

### Steps to Reproduce

1. Windows desktop app, Code tab.
2. Ask Claude to emit the same command in a ```bash fence and in a ```powershell fence.
3. The bash block renders Run + send-to-terminal + copy; the powershell block renders copy only.

### Is this a regression?

No — as far as I can tell it has always behaved this way.

### Claude Code Version

Desktop app 1.46388.4.0 (bundled CLI 2.1.260)

### Platform

Claude Desktop app (Code tab)

### Operating System

Windows 11 Pro 25H2 (10.0.26200)

### Terminal/Shell

Windows PowerShell 5.1.26100.8875 (pwsh 7 also installed)

### Related

- #89884 — open; same surface, about *which* PowerShell binary Run uses. Its fix #2 ("honor the fence language") overlaps with this report, but its subject is the binary choice, not the tag allowlist.
- #57761 — closed as not planned; asked for Run on *untagged* blocks via heuristics. This report is narrower: three explicit, unambiguous language tags, no heuristics needed.

### Screenshot

Image

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start in the desktop app's Code tab by locating the fence-language allowlist that gates the Run and send-to-terminal buttons. Reproduce on Windows with bash, powershell, pwsh, and ps1 blocks; done means the three PowerShell tags show Run and send-to-terminal while untagged blocks remain copy-only.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
powershell
領域
desktop
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
72/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。