ANSI Colors in Command Line Output

Episode #467 | 18 minutes | published on November 5, 2020
Subscribers Only
I always like it when command line programs offer colored output, which helps to discern between various stages of output, highlight errors and other important information. This is done with ANSI color codes, which are a somewhat archaic technique, but we can implement a nice wrapper to make it easy to work with in Swift.

Episode Links

Node that Xcode does not support this, so if you run the apps in Xcode you'll see the raw escape codes. To see the colored output you'll need to run the app in a Terminal window.

blog comments powered by Disqus