diff --git a/entropymon/__init__.py b/entropymon/__init__.py index de28ce5..36bc13a 100644 --- a/entropymon/__init__.py +++ b/entropymon/__init__.py @@ -1,3 +1,3 @@ """entropymon - Terminal system monitor by Electric Entropy Lab.""" -__version__ = "2.2.0" +__version__ = "2.2.1" diff --git a/entropymon/monitor.py b/entropymon/monitor.py index 39b657c..db4dd60 100755 --- a/entropymon/monitor.py +++ b/entropymon/monitor.py @@ -1990,7 +1990,7 @@ class Renderer: # ─── Intro ────────────────────────────────────────────────────────── -VERSION = "2.2.0" +VERSION = "2.2.1" LOGO_ART = [ " \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557", @@ -2667,15 +2667,9 @@ def main(): # Reset terminal state before entering curses os.system("stty sane 2>/dev/null") - # Save terminal content before curses takes over - sys.stdout.write("\033[?1049h") # switch to alternate screen - sys.stdout.flush() - try: curses.wrapper(_curses_main) except curses.error as e: - sys.stdout.write("\033[?1049l") # restore main screen - sys.stdout.flush() os.system("stty sane 2>/dev/null") term = os.environ.get("TERM", "?") print(f"\nTerminal error: {e}") @@ -2688,9 +2682,9 @@ def main(): except KeyboardInterrupt: pass finally: - sys.stdout.write("\033[?1049l") # restore main screen - sys.stdout.flush() os.system("stty sane 2>/dev/null") + sys.stdout.write("\033[2J\033[H") # clear screen + cursor home + sys.stdout.flush() if __name__ == "__main__":