Skip to content

Commit c249d10

Browse files
committed
Color output on screen256 color terminals
The Swift driver only emitted color on xterm-256color terminals. screen-256color terminals also have the ability to output colors so we can colorize the output there too. Also fixing the build deprecation warning on `ProcessEnv.vars`.
1 parent fec47e6 commit c249d10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/swift-help/main.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ struct SwiftHelp: ParsableCommand {
9393
}
9494

9595
func printIntro() {
96-
let is256Color = ProcessEnv.vars["TERM"] == "xterm-256color"
96+
let is256Color = ProcessEnv.block["TERM"] == "xterm-256color" ||
97+
ProcessEnv.block["TERM"] == "screen-256color"
9798
let orangeRed = is256Color ? "\u{001b}[1;38;5;196m" : ""
9899
let plain = is256Color ? "\u{001b}[0m" : ""
99100
let plainBold = is256Color ? "\u{001b}[1m" : ""

0 commit comments

Comments
 (0)