Skip to content

Commit

Permalink
confirm: properly clear the terminal in case of a multi-line prompt s…
Browse files Browse the repository at this point in the history
…tring.
  • Loading branch information
grunweg committed May 6, 2022
1 parent c4fdc9c commit c0575d1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/prompts/confirm.rs
Expand Up @@ -210,8 +210,8 @@ impl Confirm<'_> {
continue;
}
};

term.clear_line()?;
// Since `prompt` may be a multi-line string, we clear the entire prompt and not just the current line.
render.clear()?;
render.confirm_prompt(&self.prompt, value)?;
}
} else {
Expand All @@ -234,7 +234,8 @@ impl Confirm<'_> {
}
}

term.clear_line()?;
// Since `prompt` may be a multi-line string, we clear the entire prompt and not just the current line.
render.clear()?;
if self.report {
render.confirm_prompt_selection(&self.prompt, rv)?;
}
Expand Down

0 comments on commit c0575d1

Please sign in to comment.