Skip to content

Instantly share code, notes, and snippets.

@ileitch
Created October 9, 2023 15:43
Show Gist options
  • Save ileitch/8916f5bc961ec8206837b10bc099d613 to your computer and use it in GitHub Desktop.
Save ileitch/8916f5bc961ec8206837b10bc099d613 to your computer and use it in GitHub Desktop.
Cooler.swift
private var isColorOutputCapable: Bool = {
guard let term = ProcessInfo.processInfo.environment["TERM"],
term.lowercased() != "dumb",
isatty(fileno(stdout)) != 0 else {
return false
}
return true
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment