anthropics / anthropics/claude-code

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

Abierto Apto para principiantes
#92,872 1 comentario 0 reacciones 0 asignados Ver en GitHub
area:desktop bug platform:windows
Lenguaje dominante
Python
Estrellas
145k
Forks
23.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

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

Guía de contribución

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

Línea de trabajo

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.

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

Evaluación

Stack tecnológico
powershell
Área
desktop
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
72/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.