diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 927c03a1033..547d3f36bff 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -29,6 +29,8 @@ import bb.process
 
 logger = bb.msg.logger_create('bitbake-setup', sys.stdout)
 
+BBSETUP_COLOR = False
+
 # These settings can only be set in the global context
 GLOBAL_ONLY_SETTINGS = (
     "top-dir-prefix",
@@ -1095,6 +1097,10 @@ def main():
     elif args.quiet:
         logger.setLevel(logging.ERROR)
 
+    global BBSETUP_COLOR
+    if args.color == 'always' or (args.color == 'auto' and sys.stdout.isatty() and os.environ.get('NO_COLOR', '') == ''):
+        BBSETUP_COLOR = True
+
     # Need to re-run logger_create with color argument
     # (will be the same logger since it has the same name)
     bb.msg.logger_create('bitbake-setup', output=sys.stdout,
