File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -196,11 +196,22 @@ where
196196    let  res = if  quiet_mode { 
197197        fut. await 
198198    }  else  { 
199-         let  should_clear = bar. is_finished ( )  || bar. is_hidden ( ) ; 
200-         show_compile_progress ( bar,  & hash,  name. as_deref ( ) ) ; 
201-         let  res = fut. await ; 
202-         if  should_clear { 
203-             bar. finish_and_clear ( ) ; 
199+         // Only show the progress bar after a delay to avoid flickering and 
200+         // annoying output for fast compilations. 
201+         let  delay = tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) ; 
202+         tokio:: select! { 
203+             _ = delay => { 
204+                 let  should_clear = bar. is_finished( )  || bar. is_hidden( ) ; 
205+                 show_compile_progress( bar,  & hash,  name. as_deref( ) ) ; 
206+                 let  res = fut. await ; 
207+                 if  should_clear { 
208+                     bar. finish_and_clear( ) ; 
209+                 } 
210+                 res
211+             } 
212+             res = fut => { 
213+                 res
214+             } 
204215        } 
205216
206217        res
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments