File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
packages/core/src/prompts Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @clack/core " : patch
3+ ---
4+
5+ Fix rendering bug when using y/n to confirm
Original file line number Diff line number Diff line change 11import Prompt , { PromptOptions } from './prompt.js' ;
2-
2+ import { cursor } from 'sisteransi' ;
33
44interface ConfirmOptions extends PromptOptions < ConfirmPrompt > {
55 active : string ;
@@ -24,6 +24,7 @@ export default class ConfirmPrompt extends Prompt {
2424 } )
2525
2626 this . on ( 'confirm' , ( confirm ) => {
27+ this . output . write ( cursor . move ( 0 , - 1 ) ) ;
2728 this . value = confirm ;
2829 this . state = 'submit' ;
2930 this . close ( )
Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ export interface PromptOptions<Self extends Prompt> {
4343export type State = 'initial' | 'active' | 'cancel' | 'submit' | 'error' ;
4444
4545export default class Prompt {
46- private input : Readable ;
47- private output : Writable ;
46+ protected input : Readable ;
47+ protected output : Writable ;
4848 private rl ! : ReadLine ;
4949 private opts : Omit < PromptOptions < Prompt > , 'render' | 'input' | 'output' > ;
5050 private _track : boolean = false ;
You can’t perform that action at this time.
0 commit comments