Skip to content

docs: clarify multiline command continuations#1477

Open
KirtiRamchandani wants to merge 1 commit into
google:mainfrom
KirtiRamchandani:fix/multiline-command-literals
Open

docs: clarify multiline command continuations#1477
KirtiRamchandani wants to merge 1 commit into
google:mainfrom
KirtiRamchandani:fix/multiline-command-literals

Conversation

@KirtiRamchandani
Copy link
Copy Markdown

Fixes #1149

Problem

The getting-started guide shows arrays for long argument lists, but it does not show how to split one shell command across multiple lines. This makes it easy to write a backslash followed by trailing spaces and accidentally start a new shell command on the next line.

Root cause

zx passes literal command text to the configured shell. A newline is treated by the shell as a command separator unless it is escaped, and a backslash only continues the line when it is the final character before the newline.

Solution

Add a concise multiline fzf example and call out that trailing spaces after the continuation backslash break the command.

Tests run

  • npx prettier --check docs/getting-started.md
  • git diff --check HEAD~1..HEAD
  • Attempted npm run docs:build; it fails on the current checkout in Vite/esbuild while transforming generated VitePress app destructuring, before this Markdown content is involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple line argument passing

1 participant