Skip to content

v3.4.1: Interactive Prompt UI Hotfix & Terminal Lifecycle Engine

Choose a tag to compare

@github-actions github-actions released this 30 Aug 08:14
· 41 commits to main since this release

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, promptCheckbox and promptRadio used hardcoded static line calculations (state.length + (subtitle ? 4 : 3) and options.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 writeLine with ANSI sequence \x1b[2K\r to 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 truncatePath with 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.js covering path truncation, non-TTY execution fallbacks, and prompt calculations (13/13 test suites passing).

📦 Package Distribution

  • NPM Package: Published cybermes-mcp@3.4.1 to npm registry.
  • Run Immediately:
    npx -y cybermes-mcp@latest install