v2.2.1: Clear screen on exit
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
"""entropymon - Terminal system monitor by Electric Entropy Lab."""
|
"""entropymon - Terminal system monitor by Electric Entropy Lab."""
|
||||||
|
|
||||||
__version__ = "2.2.0"
|
__version__ = "2.2.1"
|
||||||
|
|||||||
@@ -1990,7 +1990,7 @@ class Renderer:
|
|||||||
|
|
||||||
# ─── Intro ──────────────────────────────────────────────────────────
|
# ─── Intro ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
VERSION = "2.2.0"
|
VERSION = "2.2.1"
|
||||||
|
|
||||||
LOGO_ART = [
|
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",
|
" \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
|
# Reset terminal state before entering curses
|
||||||
os.system("stty sane 2>/dev/null")
|
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:
|
try:
|
||||||
curses.wrapper(_curses_main)
|
curses.wrapper(_curses_main)
|
||||||
except curses.error as e:
|
except curses.error as e:
|
||||||
sys.stdout.write("\033[?1049l") # restore main screen
|
|
||||||
sys.stdout.flush()
|
|
||||||
os.system("stty sane 2>/dev/null")
|
os.system("stty sane 2>/dev/null")
|
||||||
term = os.environ.get("TERM", "?")
|
term = os.environ.get("TERM", "?")
|
||||||
print(f"\nTerminal error: {e}")
|
print(f"\nTerminal error: {e}")
|
||||||
@@ -2688,9 +2682,9 @@ def main():
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
sys.stdout.write("\033[?1049l") # restore main screen
|
|
||||||
sys.stdout.flush()
|
|
||||||
os.system("stty sane 2>/dev/null")
|
os.system("stty sane 2>/dev/null")
|
||||||
|
sys.stdout.write("\033[2J\033[H") # clear screen + cursor home
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user