Skip to content

basecamp comment: multiline ANSI-C quoted content can post a literal leading $ #459

@aaajiao

Description

@aaajiao

Summary

basecamp comment appears to preserve a leading $ when multiline content is passed with shell ANSI-C quoting ($'...'). The posted Basecamp comment starts with a literal $, even though the expected content starts with the first character inside the quoted string.

This is easy to hit from agent/shell workflows when posting multiline comments with attachments.

Observed

Command shape used from bash:

basecamp comment 9802493119 $'海报 mockup 方向稿:\n\n<bc-attachment ...></bc-attachment>' --in 17525144 --json

The command succeeded, but the created comment content began with a literal $:

$海报 mockup 方向稿:\n\n<bc-attachment ...>...</bc-attachment>

The attachment uploaded and rendered correctly; only the leading $ was unexpected.

Expected

The comment body should begin with:

海报 mockup 方向稿:

not:

$海报 mockup 方向稿:

Notes

This may be a shell/argument parsing edge case rather than Basecamp API behavior, but from the CLI user perspective it is surprising because the help documents:

basecamp comment <id|url> <content> [flags]

and multiline content/Markdown is a common use case for comments.

Potential fixes or mitigations:

  1. Add explicit support for --content-file / stdin content for basecamp comment, so agents can avoid fragile shell quoting for multiline rich text.
  2. Document the recommended safe multiline pattern (temp file/stdin/here-doc) and warn against $'...' if unsupported.
  3. If the CLI currently receives literal $'...' from some execution contexts, strip only the ANSI-C quote wrapper safely before posting.

Environment

  • basecamp CLI: 0.7.2
  • Command: basecamp comment
  • Context: Linux sandbox shell invoked by an agent workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions