tools/litex_term: Set ENABLE_VIRTUAL_TERMINAL_PROCESSING flag on Windows.
This commit is contained in:
parent
bfc624f23e
commit
5babcadbed
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue