From 037727b5a1c2bcf17990ca0ff564bb19daf006dc Mon Sep 17 00:00:00 2001 From: Nathan Page Date: Sun, 9 May 2021 15:06:21 -0700 Subject: [PATCH] fix mistake in readjusting --- rich/_windows.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rich/_windows.py b/rich/_windows.py index 0451a47d..b1b07864 100644 --- a/rich/_windows.py +++ b/rich/_windows.py @@ -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