You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used listr to execute commands with execa, which some of commands required sudo permission which asks for password.
However, it seems like the loading state of listr task is overriding my password prompts, giving no feedback to users to type in the password. Although I can still type in the password and press Enter, it is hard to determine that they are prompting for password.
Any solution?
The text was updated successfully, but these errors were encountered:
You can do something like this but if you change one thing in source code of project 😐
import{UpdateRenderer,render/** This is the change I was talking about */}from'listr-update-renderer'/* Some state management to export to change the state */exportconstRenderState={pause: false}exportclassMyRendererextendsUpdateRenderer{_id;_tasks;_options;render(){if(this._id){// Do not render if we are already renderingreturn;}this._id=setInterval(()=>{if(RenderState.pause){return}render(this._tasks,this._options);},100);}}
then you can do something like this in your task
task: async(ctx,task)=>{RenderState.pause=true;awaitcli.confirm('Are you sure?')RenderState.pause=false;}
I used
listr
to execute commands with execa, which some of commands requiredsudo
permission which asks for password.However, it seems like the loading state of
listr
task is overriding my password prompts, giving no feedback to users to type in the password. Although I can still type in the password and press Enter, it is hard to determine that they are prompting for password.Any solution?
The text was updated successfully, but these errors were encountered: