Windows PowerShell 5.1: non-ASCII text piped into a native command arrives as `?`
Los mantenedores suelen responder en 1 día
@akhil9tiet ya está trabajando en esto.
Desde el 26/11/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Empieza leyendo codex-rs/shell-command/src/powershell.rs y la configuración del prefijo en core/src/tools/runtimes/unified_exec.rs, incluido el tratamiento existente para #12496. Reproduce el problema en Windows PowerShell 5.1 con los pasos proporcionados para git commit -F - e inspecciona los bytes del mensaje del commit guardado. Se considera terminado cuando el texto no ASCII enviado por la tubería llega intacto y sin BOM a través de las rutas de prefijo descritas en el issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What version of Codex CLI is running?
0.172.0. The code cited below reads the same on today's main.
What subscription do you have?
Free
Which model were you using?
The default model (gpt-6-luna in the 0.156.1 session logs; the problem does not depend on the model)
What platform is your computer?
Windows 11 Home 25H2 (build 26200), Windows PowerShell 5.1.26100, git 2.55.0.windows.3, no PowerShell 7
What terminal emulator and version are you using (if applicable)?
None, codex exec
What issue are you seeing?
When Codex runs a command under Windows PowerShell 5.1, any non-ASCII text that command pipes into a native program reaches the program as ?. The program gets valid ASCII and exits 0, so nothing flags it.
I hit this with agents committing through @'…'@ | git commit -F -. In three runs out of three, a Co-authored-by: Zoé Lefèvre trailer was committed as Zo? Lef?vre, and the agent didn't notice, even the run that read the commit back with git show.
In these sessions Codex ran each command as powershell.exe -Command <command> with nothing before it, so $OutputEncoding, the encoding PowerShell uses for text piped into a native program, kept 5.1's default of ASCII (about_Preference_Variables). The UTF-8 prefix in codex-rs/shell-command/src/powershell.rs:13 doesn't cover this case: it's only added on the unified exec path (core/src/tools/runtimes/unified_exec.rs:549), and it sets [Console]::OutputEncoding, which is about what Codex reads back. PowerShell 7 defaults $OutputEncoding to UTF-8, so this shows up only when Codex falls back to powershell.exe, which is every Windows install without PowerShell 7.
What steps can reproduce the bug?
On Windows without PowerShell 7, ask Codex to run these in an empty folder:
git init -q demo
cd demo
'Zoé Lefèvre' | git -c user.name=x -c [email protected] commit -q --allow-empty -F -
git log -1 --format=%B
It prints Zo? Lef?vre, and the commit holds 0x3F bytes where é and è were. In one run the message also started with a UTF-8 BOM (EF BB BF): when the console's input code page is 65001, 5.1 writes one before anything it pipes to a native program, whatever $OutputEncoding says.
What is the expected behavior?
Zoé Lefèvre, as under PowerShell 7.
Additional information
Setting both encodings before the command fixes both symptoms:
$OutputEncoding = [Console]::InputEncoding = [System.Text.UTF8Encoding]::new()
With that line under Codex on the same machine, piped text arrived byte-exact with no BOM, and setting [Console]::InputEncoding raised no error. Adding it to the prefix, inside its try { } so the constrained language case from #12496 stays quiet, would cover it wherever the prefix runs.
- Lenguaje dominante
- Rust
- Estrellas
- 136k
- Forks
- 21.6k
- Merge medio
- 1 min
- PR fusionados (30 d)
- 997
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openai/codex
-
app bug rate-limits
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug CLI connectivity
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
core-plugins: remote bundle install keeps the temp directory before a fallible rename and leaves it behind on failurePosiblemente ocupada @akhil9tiet la tomó hace 1 día. Abiertobug CLI skills
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openai/codex#63907 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug CLI
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openai/codex#63906 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
codex login status can panic when a saved API-key value contains non-ASCII textPosiblemente ocupada @akhil9tiet la tomó hace 2 días. Abiertoauth bug CLI
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
openai/codex#63868 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de openai/codex
Issues similares
-
triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
kornia/kornia-rs#1416 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
My Caps shows "Shared" on private Caps that were never sharedPosiblemente ocupada @AksharP5 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
CapSoftware/Cap#4569 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día