Skip to content

Commit

Permalink
Get default info via interactive stream
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaHOH authored Mar 30, 2019
1 parent 1bcb368 commit 966474a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion colorama/winterm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
import sys


# from wincon.h
Expand All @@ -23,7 +24,8 @@ class WinStyle(object):
class WinTerm(object):

def __init__(self):
self._default = win32.GetConsoleScreenBufferInfo(win32.STDOUT).wAttributes
out = win32.STDOUT if sys.stdout.isatty() else win32.STDERR
self._default = win32.GetConsoleScreenBufferInfo(out).wAttributes
self.set_attrs(self._default)
self._default_fore = self._fore
self._default_back = self._back
Expand Down

0 comments on commit 966474a

Please sign in to comment.