Add ANSI color parsing support to logs

This commit is contained in:
世界
2025-11-26 22:25:48 +08:00
parent 39b10d707e
commit 437fe7ac31
2 changed files with 129 additions and 2 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ public struct LogView: View {
ScrollView {
VStack(alignment: .leading, spacing: 0) {
ForEach(Array(logList.enumerated()), id: \.offset) { it in
Text(it.element)
Text(ANSIColors.parseAnsiString(it.element))
.font(logFont)
#if os(tvOS)
.focusable()
@@ -59,7 +59,7 @@ public struct LogView: View {
ScrollView {
LazyVGrid(columns: [GridItem(.flexible())], alignment: .leading, spacing: 0) {
ForEach(Array(logClient.logList.enumerated()), id: \.offset) { it in
Text(it.element)
Text(ANSIColors.parseAnsiString(it.element))
.font(logFont)
#if os(tvOS)
.focusable()