fix(cli): Replace 'public' command with 'chan 0' to fix quote handling

Issue: Messages sent to Public channel had visible double quotes around
multi-word text (e.g., "Hello world" appeared as "Hello world" in chat).

Root cause: In interactive mode, meshcli's 'public' command treats quotes
literally as part of message content, while 'chan' command correctly parses
them as argument delimiters.

Solution: Use 'chan 0' for Public channel instead of 'public' command.
This ensures consistent quote handling across all channels.

Before:
- Public (ch 0): public "message" → quotes visible in output
- Other channels: chan <nb> "message" → quotes correctly parsed ✓

After:
- All channels: chan <nb> "message" → consistent behavior ✓

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2025-12-28 20:46:06 +01:00
parent ff0d52e281
commit ee7dde4ca2

View File

@@ -100,12 +100,9 @@ def send_message(text: str, reply_to: Optional[str] = None, channel_index: int =
else:
message = text
if channel_index == 0:
# Public channel - backward compatibility
success, stdout, stderr = _run_command(['public', message])
else:
# Other channels - use 'chan' command
success, stdout, stderr = _run_command(['chan', str(channel_index), message])
# Use 'chan' command for all channels (including Public/0) for consistent quoting behavior
# Note: 'public' command treats quotes literally, while 'chan' properly parses them as delimiters
success, stdout, stderr = _run_command(['chan', str(channel_index), message])
return success, stdout or stderr