@@ -532,14 +532,17 @@ const PrintNode = struct {
532532 last : bool = false ,
533533};
534534
535- fn printPrefix (node : * PrintNode , stderr : std.fs.File ) ! void {
535+ fn printPrefix (node : * PrintNode , stderr : std.fs.File , ttyconf : std.debug.TTY.Config ) ! void {
536536 const parent = node .parent orelse return ;
537537 if (parent .parent == null ) return ;
538- try printPrefix (parent , stderr );
538+ try printPrefix (parent , stderr , ttyconf );
539539 if (parent .last ) {
540540 try stderr .writeAll (" " );
541541 } else {
542- try stderr .writeAll ("│ " );
542+ try stderr .writeAll (switch (ttyconf ) {
543+ .no_color , .windows_api = > "| " ,
544+ .escape_codes = > "\x1B\x28\x30\x78\x1B\x28\x42 " , // │
545+ });
543546 }
544547}
545548
@@ -552,14 +555,20 @@ fn printTreeStep(
552555 step_stack : * std .AutoArrayHashMapUnmanaged (* Step , void ),
553556) ! void {
554557 const first = step_stack .swapRemove (s );
555- try printPrefix (parent_node , stderr );
558+ try printPrefix (parent_node , stderr , ttyconf );
556559
557560 if (! first ) try ttyconf .setColor (stderr , .Dim );
558561 if (parent_node .parent != null ) {
559562 if (parent_node .last ) {
560- try stderr .writeAll ("└─ " );
563+ try stderr .writeAll (switch (ttyconf ) {
564+ .no_color , .windows_api = > "+- " ,
565+ .escape_codes = > "\x1B\x28\x30\x6d\x71\x1B\x28\x42 " , // └─
566+ });
561567 } else {
562- try stderr .writeAll ("├─ " );
568+ try stderr .writeAll (switch (ttyconf ) {
569+ .no_color , .windows_api = > "+- " ,
570+ .escape_codes = > "\x1B\x28\x30\x74\x71\x1B\x28\x42 " , // ├─
571+ });
563572 }
564573 }
565574
0 commit comments