use_ansi_codes.py 376 B

123456789101112
  1. #!/usr/bin/env python
  2. # Copyright (c) 2015 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """Prints if the the terminal is likely to understand ANSI codes."""
  6. from __future__ import print_function
  7. import os
  8. # Add more terminals here as needed.
  9. print('ANSICON' in os.environ)