| ... | @@ -532,14 +532,17 @@ const PrintNode = struct { | ... | @@ -532,14 +532,17 @@ const PrintNode = struct { |
| 532 | last: bool = false, | 532 | last: bool = false, |
| 533 | }; | 533 | }; |
| 534 | | 534 | |
| 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 { |
| 536 | const parent = node.parent orelse return; | 536 | const parent = node.parent orelse return; |
| 537 | if (parent.parent == null) return; | 537 | if (parent.parent == null) return; |
| 538 | try printPrefix(parent, stderr); | 538 | try printPrefix(parent, stderr, ttyconf); |
| 539 | if (parent.last) { | 539 | if (parent.last) { |
| 540 | try stderr.writeAll(" "); | 540 | try stderr.writeAll(" "); |
| 541 | } else { | 541 | } 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 | }); |
| 543 | } | 546 | } |
| 544 | } | 547 | } |
| 545 | | 548 | |
| ... | @@ -552,14 +555,20 @@ fn printTreeStep( | ... | @@ -552,14 +555,20 @@ fn printTreeStep( |
| 552 | step_stack: *std.AutoArrayHashMapUnmanaged(*Step, void), | 555 | step_stack: *std.AutoArrayHashMapUnmanaged(*Step, void), |
| 553 | ) !void { | 556 | ) !void { |
| 554 | const first = step_stack.swapRemove(s); | 557 | const first = step_stack.swapRemove(s); |
| 555 | try printPrefix(parent_node, stderr); | 558 | try printPrefix(parent_node, stderr, ttyconf); |
| 556 | | 559 | |
| 557 | if (!first) try ttyconf.setColor(stderr, .Dim); | 560 | if (!first) try ttyconf.setColor(stderr, .Dim); |
| 558 | if (parent_node.parent != null) { | 561 | if (parent_node.parent != null) { |
| 559 | if (parent_node.last) { | 562 | 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 | }); |
| 561 | } else { | 567 | } 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 | }); |
| 563 | } | 572 | } |
| 564 | } | 573 | } |
| 565 | | 574 | |