anthropics / anthropics/claude-code

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

Ouverte Adaptée aux débutants
#92,872 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area:desktop bug platform:windows
Langage dominant
Python
Étoiles
145k
Forks
23.1k
Métriques de merge des PR
Métriques de PR en attente

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
powershell
Domaine
desktop
Type d'issue
Bug
Difficulté
2/5
Temps estimé
1-3 heures
Activité
Active
Clarté
Clairement spécifiée
Accessibilité débutants
72/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.