Commit 389412a6 authored by Michael Büsch's avatar Michael Büsch

cli: Use escapes only on posix platforms

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent bc8075a1
......@@ -110,15 +110,22 @@ lastDump = ""
def clearConsole():
# Make cursor visible, clear console and
# move cursor to homeposition.
writeStdout("\x1B[?25h\x1B[2J\x1B[H")
if osIsPosix:
writeStdout("\x1B[?25h\x1B[2J\x1B[H")
elif osIsWindows:
os.system("cls")
def emitCpuDump(dump):
# Pad lines
dump = '\n'.join(line + (79 - len(line)) * ' ' + '|'
dump = '\n'.join(line + (78 - len(line)) * ' ' + '|'
for line in dump.splitlines())
global lastDump
lastDump = dump
writeStdout("\x1B[H" + dump)
if osIsPosix:
writeStdout("\x1B[H" + dump)
else:
clearConsole()
writeStdout(dump)
def cpuDumpCallback(cpu):
global nextScreenUpdate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment