From 56b7c335e8b725a1a586841e59876746db72d1f2 Mon Sep 17 00:00:00 2001 From: MarekWo Date: Sun, 28 Dec 2025 15:52:06 +0100 Subject: [PATCH] fix(bridge): Quote command arguments to preserve spaces in messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users reported messages with spaces were truncated to first word. Root cause: ' '.join(args) didn't quote arguments with spaces. Changes: - Import shlex module - Use shlex.quote() for each argument in execute_command() - Example: ['public', 'To jest test'] → "public 'To jest test'" This ensures meshcli receives multi-word messages correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- meshcore-bridge/bridge.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meshcore-bridge/bridge.py b/meshcore-bridge/bridge.py index 04d11dd..3adee7e 100644 --- a/meshcore-bridge/bridge.py +++ b/meshcore-bridge/bridge.py @@ -18,6 +18,7 @@ import time import json import queue import uuid +import shlex from pathlib import Path from flask import Flask, request, jsonify @@ -325,7 +326,8 @@ class MeshCLISession: Dict with success, stdout, stderr, returncode """ cmd_id = str(uuid.uuid4())[:8] - command = ' '.join(args) + # Properly quote arguments containing spaces/special chars + command = ' '.join(shlex.quote(arg) for arg in args) event = threading.Event() response_dict = { "event": event,