v3.4.1: Interactive Prompt UI Hotfix & Terminal Lifecycle Engine
Overview
Cybermes v3.4.1 is a critical patch release for cybermes-mcp resolving interactive CLI installer UI rendering artifacts, off-by-one cursor jumping, duplicated client entries, ghosting text on terminal redraws, and cursor visibility resets across Windows Terminal, PowerShell, CMD, macOS, and Linux consoles.
🐛 Bug Fixes & Clarifications
1. Dynamic Frame Tracking Engine (npm/src/utils/prompt.js)
- Root Cause: Previously,
promptCheckboxandpromptRadioused hardcoded static line calculations (state.length + (subtitle ? 4 : 3)andoptions.length + 3), which overshot the prompt origin by +1 line on every keypress (off-by-one error). - Fix: Replaced static line arithmetic with dynamic frame tracking (
lastRenderedLineCount). The cursor now moves up by the exact rendered line count of the previous frame.
2. Universal Line Erasing (\x1b[2K\r)
- Root Cause: Redrawing lines without prior line-clearing left trailing characters from previous longer lines (e.g.
Mode: NPX Command (npx -y cybermes-mcp)rmes MCP::). - Fix: Implemented
writeLinewith ANSI sequence\x1b[2K\rto cleanly erase the full line before writing headers, subtitles, instructions, and client items.
3. Smart Path Truncation for Narrow Terminals
- Root Cause: Long configuration file paths (e.g., in VS Code extensions or AppData) exceeded terminal window width on narrow consoles (< 90 columns), triggering soft line-wrapping and desynchronizing cursor coordinates, which led to repeated printing of bottom items like
Codex CLI. - Fix: Added
truncatePathwith dynamic column width detection (process.stdout.columns) to cleanly abbreviate long paths (e.g.C:\Users\...\cline_mcp_settings.json) without line wraps.
4. Terminal Cursor Lifecycle & Safety Handlers
- Root Cause: The terminal blinking cursor remained active during interactive menus and left visual artifacts (
| > [x]). - Fix: Terminal cursor is now hidden (
\x1b[?25l) on prompt initialization and restored (\x1b[?25h) upon completion, cancellation (Ctrl+C), and process exit hooks.
5. Automated Regression Test Suite (Test 13)
- Added comprehensive unit tests in
npm/test.jscovering path truncation, non-TTY execution fallbacks, and prompt calculations (13/13 test suites passing).
📦 Package Distribution
- NPM Package: Published
cybermes-mcp@3.4.1to npm registry. - Run Immediately:
npx -y cybermes-mcp@latest install