docs: warn against bash ANSI-C quoting for multiline comment content#517
Conversation
Under a POSIX /bin/sh (dash, busybox-ash — common in agent sandboxes), $'...' is not ANSI-C quoting: the $ is passed through literally and \n stays a backslash-n. This posts a stray leading $ on comment content, as reported in #459. Document the stdin ('-') pattern as the safe alternative in both the comments create/update help text and the Basecamp skill. Refs #459
There was a problem hiding this comment.
Pull request overview
Documents a common shell-quoting pitfall when posting Basecamp comments via the CLI: bash/zsh ANSI‑C quoting ($'...') can be passed through literally under POSIX /bin/sh, resulting in a stray leading $ and literal \n sequences being posted. This updates user-facing guidance to recommend the existing, safer stdin (-) pattern instead of attempting risky content “fixups” in the CLI.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Adds a warning + stdin recommendation to
basecamp comments createhelp text, including an example pipeline. - Adds a similar warning + stdin recommendation to
basecamp comments updatehelp text. - Updates
skills/basecamp/SKILL.mdwith the same guidance for agent workflows.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/commands/comment.go | Updates CLI help text for comments create/comments update to warn against $'...' under POSIX sh and recommend stdin (-). |
| skills/basecamp/SKILL.md | Adds the same guidance in the agent skill documentation, with a concrete stdin example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Documentation-only change addressing #459, where
basecamp commentposted a comment with a stray leading$.Root cause
Not a CLI bug — a shell quoting issue. The reporter used bash ANSI-C quoting:
basecamp comment 9802493119 $'海报 mockup 方向稿:\n\n<bc-attachment ...>' --in ... --json$'...'is a bash/zsh extension, not POSIX. Under a POSIX/bin/sh(dash, busybox-ash — the default in most Linux sandboxes and "agent workflow" shells),$'...'is parsed as a literal$followed by an ordinary single-quoted string. The CLI then faithfully posts exactly what the shell handed it.The smoking gun is in the issue's own output: the posted HTML contains both the literal
$and literal\n\n(backslash-n, not real newlines). If bash had interpreted$'...', the\nwould have become real newlines and the$/quotes consumed. Their survival proves a POSIXshran the command.Why not "fix" it in the CLI
The issue floated stripping the
$'...'wrapper inside the CLI. Rejected:$and'are legitimate content characters (prices, code, apostrophes), and the app can't know a leading$was an unintended quote wrapper. Guessing at shell intent would silently corrupt real content.The safe alternative — stdin via
-, bare pipe, and--edit— already exists. This PR just documents it.Changes
comments create/comments updatehelp text: warn against$'...'for multiline/non-ASCII content, recommend the stdin (-) pattern.skills/basecamp/SKILL.md: same guidance in the content-fields section, extending the existingprintf %qquoting advice.Note
bin/cicurrently fails on this branch's base due to a pre-existing, unrelated build breakage ininternal/commands/cards.go(the SDK'sCardColumns.EnableOnHold/DisableOnHold/SetColorgained acolumnIDparameter thatcards.gohasn't been updated for). It exists on the clean base independent of this change; this PR only touches help-text strings and Markdown (gofmt-clean).Summary by cubic
Warns against using bash ANSI-C quoting
$'...'for multiline or non-ASCII comment content, which under POSIX/bin/shposts a stray$and keeps\nliterally. Updates thebasecamp comments create/updatehelp to recommend stdin with-, and adds the same guidance toskills/basecamp/SKILL.md(addresses #459).Written for commit 471fdc7. Summary will update on new commits.