1+ import readline from 'readline' ;
12import {
23 ConfirmPrompt ,
34 GroupMultiSelectPrompt ,
@@ -12,7 +13,6 @@ import {
1213} from '@clack/core' ;
1314import isUnicodeSupported from 'is-unicode-supported' ;
1415import color from 'picocolors' ;
15- import readline from 'readline' ;
1616import { cursor , erase } from 'sisteransi' ;
1717
1818export { isCancel } from '@clack/core' ;
@@ -31,6 +31,8 @@ const S_BAR_END = s('└', '—');
3131
3232const S_RADIO_ACTIVE = s ( '●' , '>' ) ;
3333const S_RADIO_INACTIVE = s ( '○' , ' ' ) ;
34+ const S_SUBTASK_ACTIVE = s ( '▸' , '>' ) ;
35+ const S_SUBTASK_INACTIVE = s ( '▹' , ' ' ) ;
3436const S_CHECKBOX_ACTIVE = s ( '◻' , '[•]' ) ;
3537const S_CHECKBOX_SELECTED = s ( '◼' , '[+]' ) ;
3638const S_CHECKBOX_INACTIVE = s ( '◻' , '[ ]' ) ;
@@ -763,25 +765,25 @@ function ansiRegex() {
763765export type SpinnerGroup = [ message : string , run : ( ) => Promise < void > ] ;
764766
765767export const spinnerGroup = async ( outerMessage : string , groups : SpinnerGroup [ ] ) => {
766- process . stdout . write ( `${ color . gray ( S_BAR ) } \n ${ S_BAR_START } ${ outerMessage } \n` ) ;
768+ process . stdout . write ( `${ color . gray ( S_BAR ) } \n ${ outerMessage } \n` ) ;
767769
768770 const s = spinner ( ) ;
769771 let caught : [ group : SpinnerGroup , error : unknown ] | undefined ;
770772
771773 for ( const [ message , run ] of groups ) {
772- const line = `${ color . gray ( S_BAR ) } ${ message } ` ;
773774 readline . clearLine ( process . stdout , - 1 ) ;
774775 readline . moveCursor ( process . stdout , - 999 , - 1 ) ;
775776
776- s . start ( line ) ;
777+ s . start ( ` ${ color . green ( S_SUBTASK_ACTIVE ) } ${ message } ` ) ;
777778 await run ( ) . catch ( ( error ) => {
778779 caught = [ [ message , run ] , error ] ;
779780 } ) ;
780- s . stop ( line ) ;
781781
782782 if ( caught ) {
783+ s . stop ( `${ color . red ( S_SUBTASK_ACTIVE ) } ${ message } ` ) ;
783784 break ;
784785 }
786+ s . stop ( `${ color . gray ( S_SUBTASK_INACTIVE ) } ${ message } ` ) ;
785787 }
786788
787789 if ( caught ) {
0 commit comments