@@ -113,8 +113,8 @@ impl<'task> CommandExecutor<'task> {
113113 interactive : bool ,
114114 ) -> miette:: Result < Output > {
115115 match ( stream, interactive) {
116- ( true , false ) | ( true , true ) => command. exec_stream_and_capture_output ( ) . await ,
117- ( false , true ) => command. exec_stream_output ( ) . await ,
116+ ( true , true ) | ( false , true ) => command. exec_stream_output ( ) . await ,
117+ ( true , false ) => command. exec_stream_and_capture_output ( ) . await ,
118118 _ => command. exec_capture_output ( ) . await ,
119119 }
120120 }
@@ -293,10 +293,11 @@ impl<'task> CommandExecutor<'task> {
293293
294294 fn prepare_state ( & mut self , context : & ActionContext , report_item : & mut TaskReportItem ) {
295295 let is_primary = context. is_primary_target ( & self . task . target ) ;
296+ let is_ci = is_ci_env ( ) ;
296297
297298 // When a task is configured as local (no caching), or the interactive flag is passed,
298299 // we don't "capture" stdout/stderr (which breaks stdin) and let it stream natively.
299- if !self . task . options . cache && context. primary_targets . len ( ) == 1 {
300+ if !self . task . options . cache && context. primary_targets . len ( ) == 1 && !is_ci {
300301 self . interactive = true ;
301302 }
302303
@@ -305,7 +306,7 @@ impl<'task> CommandExecutor<'task> {
305306 self . stream = if let Some ( output_style) = & self . task . options . output_style {
306307 matches ! ( output_style, TaskOutputStyle :: Stream )
307308 } else {
308- is_primary || is_ci_env ( )
309+ is_primary || is_ci
309310 } ;
310311
311312 // If only a single persistent task is being ran, we should not prefix the output.
0 commit comments