Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`codex doctor` fails the terminal check when any TERMINFO_DIRS entry does not exist

Aperta Adatta ai principianti
#48,707 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cli, testing

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

bug CLI
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_DIRS exists or is readable; or, stricter,
  • no terminfo entry for $TERM can 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openai/codex

Tutte le issue di openai/codex

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.