@@ -748,6 +748,49 @@ mod tests {
748748 assert_snapshot ! ( "transcript_overlay_apply_patch_scroll_vt100" , snapshot) ;
749749 }
750750
751+ #[ test]
752+ fn transcript_overlay_wraps_long_exec_output_lines ( ) {
753+ let marker = "Z" ;
754+ let long_line = marker. repeat ( 200 ) ;
755+
756+ let mut exec_cell = crate :: exec_cell:: new_active_exec_command (
757+ "exec-long" . into ( ) ,
758+ vec ! [ "bash" . into( ) , "-lc" . into( ) , "echo long" . into( ) ] ,
759+ vec ! [ ParsedCommand :: Unknown {
760+ cmd: "echo long" . into( ) ,
761+ } ] ,
762+ ExecCommandSource :: Agent ,
763+ None ,
764+ false ,
765+ ) ;
766+ exec_cell. complete_call (
767+ "exec-long" ,
768+ CommandOutput {
769+ exit_code : 0 ,
770+ aggregated_output : format ! ( "{long_line}\n " ) ,
771+ formatted_output : long_line,
772+ } ,
773+ Duration :: from_millis ( 10 ) ,
774+ ) ;
775+ let exec_cell: Arc < dyn HistoryCell > = Arc :: new ( exec_cell) ;
776+
777+ let mut overlay = TranscriptOverlay :: new ( vec ! [ exec_cell] ) ;
778+ let area = Rect :: new ( 0 , 0 , 20 , 10 ) ;
779+ let mut buf = Buffer :: empty ( area) ;
780+
781+ overlay. render ( area, & mut buf) ;
782+ let rendered = buffer_to_text ( & buf, area) ;
783+
784+ let wrapped_lines = rendered
785+ . lines ( )
786+ . filter ( |line| line. contains ( marker) )
787+ . count ( ) ;
788+ assert ! (
789+ wrapped_lines >= 2 ,
790+ "expected long exec output to wrap into multiple lines in transcript overlay, got:\n {rendered}"
791+ ) ;
792+ }
793+
751794 #[ test]
752795 fn transcript_overlay_keeps_scroll_pinned_at_bottom ( ) {
753796 let mut overlay = TranscriptOverlay :: new (
0 commit comments