mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-10 10:49:45 +00:00
@@ -5659,7 +5659,6 @@ def windows_enable_vt_mode():
|
||||
|
||||
dll = ctypes.WinDLL('kernel32', use_last_error=False)
|
||||
handle = os.open('CONOUT$', os.O_RDWR)
|
||||
|
||||
try:
|
||||
h_out = ctypes.wintypes.HANDLE(msvcrt.get_osfhandle(handle))
|
||||
dw_original_mode = ctypes.wintypes.DWORD()
|
||||
@@ -5671,15 +5670,13 @@ def windows_enable_vt_mode():
|
||||
dw_original_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING))
|
||||
if not success:
|
||||
raise Exception('SetConsoleMode failed')
|
||||
except Exception as e:
|
||||
write_string(f'WARNING: Cannot enable VT mode - {e}')
|
||||
else:
|
||||
global WINDOWS_VT_MODE
|
||||
WINDOWS_VT_MODE = True
|
||||
supports_terminal_sequences.cache_clear()
|
||||
finally:
|
||||
os.close(handle)
|
||||
|
||||
global WINDOWS_VT_MODE
|
||||
WINDOWS_VT_MODE = True
|
||||
supports_terminal_sequences.cache_clear()
|
||||
|
||||
|
||||
_terminal_sequences_re = re.compile('\033\\[[^m]+m')
|
||||
|
||||
|
Reference in New Issue
Block a user