v2.1.1: Fix curs_set() ERR on xterm-color and limited terminals
- Wrap all curs_set(0) calls in try/except for terminals that don't support cursor hiding - Safe guard init_colors() for terminals with <8 colors 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.1.0"
|
__version__ = "2.1.1"
|
||||||
|
|||||||
@@ -218,8 +218,13 @@ C_WHITE_BOLD = 20
|
|||||||
|
|
||||||
|
|
||||||
def init_colors():
|
def init_colors():
|
||||||
|
try:
|
||||||
curses.start_color()
|
curses.start_color()
|
||||||
curses.use_default_colors()
|
curses.use_default_colors()
|
||||||
|
except curses.error:
|
||||||
|
pass
|
||||||
|
if curses.COLORS < 8:
|
||||||
|
return
|
||||||
curses.init_pair(C_TITLE, curses.COLOR_CYAN, -1)
|
curses.init_pair(C_TITLE, curses.COLOR_CYAN, -1)
|
||||||
curses.init_pair(C_LOW, curses.COLOR_GREEN, -1)
|
curses.init_pair(C_LOW, curses.COLOR_GREEN, -1)
|
||||||
curses.init_pair(C_MED, curses.COLOR_YELLOW, -1)
|
curses.init_pair(C_MED, curses.COLOR_YELLOW, -1)
|
||||||
@@ -1971,7 +1976,7 @@ class Renderer:
|
|||||||
|
|
||||||
# ─── Intro ──────────────────────────────────────────────────────────
|
# ─── Intro ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
VERSION = "2.1.0"
|
VERSION = "2.1.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",
|
||||||
@@ -2002,7 +2007,10 @@ BOOT_LINES = [
|
|||||||
|
|
||||||
def intro_splash(stdscr):
|
def intro_splash(stdscr):
|
||||||
"""Animated boot splash inspired by Spectre/Pulse."""
|
"""Animated boot splash inspired by Spectre/Pulse."""
|
||||||
|
try:
|
||||||
curses.curs_set(0)
|
curses.curs_set(0)
|
||||||
|
except curses.error:
|
||||||
|
pass
|
||||||
stdscr.nodelay(False)
|
stdscr.nodelay(False)
|
||||||
stdscr.timeout(20)
|
stdscr.timeout(20)
|
||||||
init_colors()
|
init_colors()
|
||||||
@@ -2235,7 +2243,10 @@ show_intro = True
|
|||||||
|
|
||||||
def _mini_splash(stdscr):
|
def _mini_splash(stdscr):
|
||||||
"""Quick 1-second mini splash when full intro is disabled."""
|
"""Quick 1-second mini splash when full intro is disabled."""
|
||||||
|
try:
|
||||||
curses.curs_set(0)
|
curses.curs_set(0)
|
||||||
|
except curses.error:
|
||||||
|
pass
|
||||||
init_colors()
|
init_colors()
|
||||||
h, w = stdscr.getmaxyx()
|
h, w = stdscr.getmaxyx()
|
||||||
stdscr.erase()
|
stdscr.erase()
|
||||||
@@ -2269,7 +2280,10 @@ def _curses_main(stdscr):
|
|||||||
else:
|
else:
|
||||||
_mini_splash(stdscr)
|
_mini_splash(stdscr)
|
||||||
|
|
||||||
|
try:
|
||||||
curses.curs_set(0)
|
curses.curs_set(0)
|
||||||
|
except curses.error:
|
||||||
|
pass
|
||||||
stdscr.nodelay(True)
|
stdscr.nodelay(True)
|
||||||
init_colors()
|
init_colors()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user