From 9896f3c1fa8337a9c0fb7950e322c4d5446a8d74 Mon Sep 17 00:00:00 2001 From: luoxiu Date: Mon, 10 Aug 2020 22:04:41 +0800 Subject: [PATCH] xcode doesn't support colors --- Package.resolved | 4 ++-- Sources/Chalk/TerminalSupportedColor.swift | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Package.resolved b/Package.resolved index cec999f..512ec7e 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/luoxiu/Rainbow", "state": { "branch": null, - "revision": "9bc8fa136c8cec2f4a5c8ad1e8d37753e05db9d5", - "version": "0.1.0" + "revision": "9d8fcb4c64e816a135c31162a0c319e9f1f09c35", + "version": "0.1.1" } } ] diff --git a/Sources/Chalk/TerminalSupportedColor.swift b/Sources/Chalk/TerminalSupportedColor.swift index 4e86367..f6ce594 100644 --- a/Sources/Chalk/TerminalSupportedColor.swift +++ b/Sources/Chalk/TerminalSupportedColor.swift @@ -29,6 +29,10 @@ public enum TerminalSupportedColor { let env = ProcessInfo.processInfo.environment + if let name = env["XPC_SERVICE_NAME"], name.starts(with: "com.apple.dt.Xcode") { + return .none + } + if env["CI"] != nil { for ci in ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"] { if env[ci] != nil { return .ansi16 }