fix mistake in readjusting

This commit is contained in:
Nathan Page 2021-05-09 15:06:21 -07:00
parent c1f04c05e6
commit 037727b5a1
1 changed files with 5 additions and 4 deletions

View File

@ -53,10 +53,11 @@ else:
result = _GetConsoleMode(handle, console_mode)
vt = bool(result and console_mode.value & ENABLE_VIRTUAL_TERMINAL_PROCESSING)
truecolor = False
win_version = sys.getwindowsversion() # type: ignore # expected to only work on windows
truecolor = win_version.major > 10 or (
win_version.major == 10 and win_version.build >= 15063
)
if vt:
win_version = sys.getwindowsversion() # type: ignore # expected to only work on windows
truecolor = win_version.major > 10 or (
win_version.major == 10 and win_version.build >= 15063
)
features = WindowsConsoleFeatures(vt=vt, truecolor=truecolor)
return features