`codex doctor` fails the terminal check when any TERMINFO_DIRS entry does not exist
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
Direzione di ricerca
Inizia in codex-rs/cli/src/doctor.rs, in push_terminfo_details e terminal_path_readiness, quindi esamina il test snapshot terminal_check_prioritizes_unreadable_terminfo_over_warnings. Riproduci i casi misti di TERMINFO_DIRS descritti nell’issue e aggiungi la relativa copertura; il lavoro è completato quando le voci mancanti del percorso di ricerca sono solo informative, mentre i dati del terminale effettivamente non leggibili o non risolvibili continuano a segnalare un problema.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What version of Codex CLI is running?
0.157.1 (codex-package-x86_64-unknown-linux-musl); the same code is on main.
What subscription do you have?
Plus
Which model were you using?
N/A (codex doctor only)
What platform is your computer?
Linux 7.2.7 x86_64 (NixOS)
What terminal emulator and version are you using (if applicable)?
Any. The check depends only on the environment.
Codex doctor report
✗ terminal TERMINFO unreadable - terminal capabilities are unknown
TERM xterm-256color
TERMINFO_DIRS entry /home/user/.local/share/flatpak/exports/share/terminfo (missing)
TERMINFO_DIRS entry /var/lib/flatpak/exports/share/terminfo (missing)
TERMINFO_DIRS entry /home/user/.nix-profile/share/terminfo (missing)
TERMINFO_DIRS entry /nix/profile/share/terminfo (missing)
TERMINFO_DIRS entry /home/user/.local/state/nix/profile/share/terminfo (missing)
TERMINFO_DIRS entry /etc/profiles/per-user/user/share/terminfo (dir)
TERMINFO_DIRS entry /nix/var/nix/profiles/default/share/terminfo (missing)
TERMINFO_DIRS entry /run/current-system/sw/share/terminfo (dir)
What issue are you seeing?
The terminal check reports Fail with "TERMINFO unreadable - terminal capabilities are unknown" whenever any entry in TERMINFO_DIRS does not exist, even though other entries are readable and contain the entry for $TERM.
TERMINFO_DIRS is a search path. ncurses and other terminfo readers skip missing entries. Distributions often set it to a list of candidate profile directories where only some exist. NixOS does this by default: it lists every possible Nix and flatpak profile. So on a stock NixOS install codex doctor always fails this check, even though terminal capabilities resolve fine.
The cause is in push_terminfo_details (codex-rs/cli/src/doctor.rs). Each TERMINFO_DIRS entry goes through terminal_path_readiness, which returns warning = true for NotFound. The results are OR-ed into has_warning, and that raises the CheckStatus::Fail issue.
What steps can reproduce the bug?
# passes
TERM=xterm-256color TERMINFO_DIRS=/usr/share/terminfo codex doctor
# fails: a missing entry first or last is enough
TERM=xterm-256color TERMINFO_DIRS=/nonexistent:/usr/share/terminfo codex doctor
TERM=xterm-256color TERMINFO_DIRS=/usr/share/terminfo:/nonexistent codex doctor
(Replace /usr/share/terminfo with any existing terminfo directory.)
What is the expected behavior?
Missing TERMINFO_DIRS entries should be listed in the details as informational, not treated as a failure. A reasonable rule would be to report a problem only when:
$TERMINFO, which names one explicit directory, is set but unreadable; or- no entry in
TERMINFO_DIRSexists or is readable; or, stricter, - no terminfo entry for
$TERMcan be found on the effective search path.
Unreadable entries that exist, such as permission errors, could still be flagged as a warning.
Additional information
The existing snapshot test terminal_check_prioritizes_unreadable_terminfo_over_warnings covers an unreadable TERMINFO. It doesn't cover a mixed TERMINFO_DIRS list, which is where this regression hides.
I used an AI assistant (Claude Code) to help investigate and draft this report. I reproduced and verified the behavior myself.
- Lingua principale
- Rust
- Stelle
- 127k
- Fork
- 19.9k
- Merge medio
- 1m
- PR unite (30g)
- 996
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openai/codex
-
bug CLI tool-calls windows-os
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
openai/codex#49760 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
app bug session
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug CLI exec
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
bug CLI TUI
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
openai/codex#49350 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
documentation memory
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di openai/codex
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
stellar/stellar-cli#2773 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
voidzero-dev/oxc-angular-compiler#511 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
yantrikos/yantrik-os#539 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
documentation station:mac ui-dashboard
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
rolter-ai/rolter#2490 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno