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

Interactive fix-confirmation prompt doesn't render under default (fancy) progress mode

Aperta
#345 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
cli

Direzione di ricerca

Riproduci il problema con il comando scope doctor fornito in un vero terminale interattivo, quindi esamina prompt_user in src/doctor/runner.rs:380-392 e la configurazione di IndicatifWriter in src/shared/logging.rs:340-346. Traccia il modo in cui suspend_tracing_indicatif interagisce con il fancy spinner durante l’input di inquire. Il lavoro è completo quando il prompt di conferma viene visualizzato e accetta l’input in default progress mode, mentre plain progress continua a funzionare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

doctor run --fix=true prompts for confirmation before running a fix (prompt_user in src/doctor/runner.rs:380-392). In the default progress mode (the tracing_indicatif spinner UI), that prompt doesn't visibly render in a real terminal — it appears to hang. Switching to --progress plain makes the prompt show up immediately and work correctly.

The prompt code already wraps itself in tracing_indicatif::suspend_tracing_indicatif specifically to pause the spinner while inquire reads input:

// src/doctor/runner.rs:380-392
fn prompt_user(prompt_text: &str, maybe_help_text: &Option<String>) -> bool {
    tracing_indicatif::suspend_tracing_indicatif(|| {
        let prompt = {
            let base_prompt = inquire::Confirm::new(prompt_text).with_default(false);
            match maybe_help_text {
                Some(help_text) => base_prompt.with_help_message(help_text),
                None => base_prompt,
            }
        };

        prompt.prompt().unwrap_or(false)
    })
}

That suspend doesn't fully prevent the spinner from stomping on the prompt render — this predates today's work (confirmed via git blame, unrelated to #341/#342/#343 merged earlier today) and isn't a regression, but it's a real, reproducible UX bug in a real interactive terminal.

Reproduction (MVCE)

mkdir -p /tmp/scope-prompt-hang/.scope
cat > /tmp/scope-prompt-hang/.scope/group.yaml <<'YAML'
apiVersion: scope.github.com/v1alpha
kind: ScopeDoctorGroup
metadata:
  name: prompt-hang-repro
spec:
  actions:
    - name: needs-file
      check: { commands: ["test -f needed.txt"] }
      fix:
        prompt:
          text: "Create needed.txt?"
        commands:
          - "touch needed.txt"
YAML

cd /tmp/scope-prompt-hang
scope doctor run --fix=true --no-cache

Run this from a real interactive terminal (not piped, --yolo not set).

Expected: the "Create needed.txt? (y/n)" prompt renders immediately and accepts input.

Actual: nothing visibly renders — the terminal appears to hang. Adding --progress plain:

scope doctor run --fix=true --no-cache --progress plain

...makes the same prompt render and behave correctly right away.

Suggested fix

Investigate why suspend_tracing_indicatif isn't fully suppressing the spinner's terminal writes during the inquire prompt in fancy-progress mode — possibly a race between the spinner's redraw tick and inquire taking over the terminal, or an interaction with the IndicatifWriter used for stdout/stderr (src/shared/logging.rs:340-346).

🤖 Generated with Claude Code

Lingua principale
Rust
Stelle
3
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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 Gusto/scope

Tutte le issue di Gusto/scope

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.