From 2a1fb9beab1c440615a72cfd877163da4d4adb5c Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Tue, 7 Mar 2023 23:07:58 -0500 Subject: [PATCH] [+] Clear terminal function --- tngame/telnet.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tngame/telnet.py b/tngame/telnet.py index af34860..a0b3089 100644 --- a/tngame/telnet.py +++ b/tngame/telnet.py @@ -29,6 +29,13 @@ COLORS = {RGB.from_hex(v) for v in { async def shell(reader: TelnetReaderUnicode, writer: TelnetWriterUnicode): + + def clear(): + # Clear the screen + writer.write('\x1b[2J') + writer.write('\x1b[H') + + clear() x, y = 0, height - ASCII_HEIGHT