Skip to content

Commit

Permalink
fixed win color issue #8
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamkrishnar committed Jun 25, 2016
1 parent df4e1b8 commit 983faf8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion socli/socli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ def supports_color():
"""
plat = sys.platform
supported_platform = plat != 'Pocket PC' and (plat != 'win32' or 'ANSICON' in os.environ)

# To detect windows 10 cmd. Windows 10 cmd supports color by default
if os.name=="nt":
x=sys.getwindowsversion()[0]
if x==10:
try:
test_shell=os.environ['SHELL'] # If running with a shell like cygwin this is set
except Exception:
return True
# isatty is not always implemented, #6223.
is_a_tty = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
if not supported_platform or not is_a_tty:
Expand Down

0 comments on commit 983faf8

Please sign in to comment.