Interactive fix-confirmation prompt doesn't render under default (fancy) progress mode
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the provided scope doctor command in a real interactive terminal, then inspect prompt_user in src/doctor/runner.rs:380-392 and the IndicatifWriter setup in src/shared/logging.rs:340-346. Trace how suspend_tracing_indicatif interacts with the fancy spinner during inquire input. Done means the confirmation prompt renders and accepts input in default progress mode, while plain progress continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100