tools/litex_term: Set ENABLE_VIRTUAL_TERMINAL_PROCESSING flag on Windows.

This commit is contained in:
William D. Jones 2021-01-11 19:54:21 -05:00
parent bfc624f23e
commit 5babcadbed
1 changed files with 5 additions and 1 deletions

View File

@ -22,10 +22,14 @@ import telnetlib
# Console ------------------------------------------------------------------------------------------ # Console ------------------------------------------------------------------------------------------
if sys.platform == "win32": if sys.platform == "win32":
import ctypes
import msvcrt import msvcrt
class Console: class Console:
def configure(self): def configure(self):
pass # https://stackoverflow.com/a/36760881
# ENABLE_VIRTUAL_TERMINAL_PROCESSING
kernel32 = ctypes.windll.kernel32
kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
def unconfigure(self): def unconfigure(self):
pass pass