From 874e11c92af483865e677aef9111e0f921bef15a Mon Sep 17 00:00:00 2001 From: MarekWo Date: Sat, 3 Jan 2026 16:22:34 +0100 Subject: [PATCH] fix: Replace hardcoded device name with regex pattern for prompt detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced hardcoded "MarWoj" device name with regex pattern to support any device name in meshcli prompt detection. The prompt format is |* and varies per installation. Changes: - Line 430: Use re.match(r'^.+\|\*', line) instead of line.startswith('MarWoj|*') - Line 667: Update comment to use generic placeholder This ensures the code works correctly for all users regardless of their meshcore device name configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- app/meshcore/cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/meshcore/cli.py b/app/meshcore/cli.py index 10cad21..dae93df 100644 --- a/app/meshcore/cli.py +++ b/app/meshcore/cli.py @@ -426,8 +426,8 @@ def get_all_contacts_detailed() -> Tuple[bool, List[Dict], int, str]: lines = stdout.strip().split('\n') for line in lines: - # Skip prompt lines and empty lines - if line.startswith('MarWoj|*') or not line.strip(): + # Skip prompt lines and empty lines (prompt format: |*) + if re.match(r'^.+\|\*', line) or not line.strip(): continue # Check for final count line: "> 263 contacts in device" @@ -664,7 +664,7 @@ def get_contacts_json() -> Tuple[bool, Dict[str, Dict], str]: return False, {}, '.contacts command returned empty output' # Parse JSON output - use brace-matching to extract complete JSON object - # stdout format: "MarWoj|* .contacts\n{...}\nMarWoj|* " + # stdout format: "|* .contacts\n{...}\n|* " # We need to find matching braces and parse only the JSON object try: # Use brace-matching to extract complete JSON object (same as bridge does)