From 5babcadbed4c9208af04ef7bc1c8553c65872383 Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Mon, 11 Jan 2021 19:54:21 -0500 Subject: [PATCH] tools/litex_term: Set ENABLE_VIRTUAL_TERMINAL_PROCESSING flag on Windows. --- litex/tools/litex_term.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litex/tools/litex_term.py b/litex/tools/litex_term.py index 37b74feb7..48ef631d9 100755 --- a/litex/tools/litex_term.py +++ b/litex/tools/litex_term.py @@ -22,10 +22,14 @@ import telnetlib # Console ------------------------------------------------------------------------------------------ if sys.platform == "win32": + import ctypes import msvcrt class Console: 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): pass