claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Backslash Handling Issues in CLI Commands

Open Cheffromspace opened this issue 7 months ago • 0 comments

Environment

  • [x] Anthropic API
  • Shell: /usr/bin/zsh
  • OS: Ubuntu 24.04.2 LTS (Noble)
  • Git: version 2.43.0
  • Node: v23.10.0
  • Claude Code: 0.2.122
  • Windows Terminal via SSH

Description

Claude Code CLI has issues processing commands with backslashes as line continuations. The CLI appears to treat the backslash literally rather than as a line continuation character.

Reproduction Steps

  1. Run a multi-line command with backslashes for line continuation
  2. Example:
    git rm --cached \
    /path/to/file1 \
    /path/to/file2
    

Expected Behavior

Command should be interpreted as a single line with the backslashes properly handling line continuation.

Actual Behavior

Receiving error: fatal: pathspec '' did not match any files

The CLI interprets the backslash as a literal character rather than line continuation, causing the command to fail.

Logs

Bash(git rm --cached \
/home/jonflatt/n8n/claude-repo/test/test-debug-claude.sh \
...)
⎿ Error: fatal: pathspec '\' did not match any files

Working around by putting commands on a single line works correctly.

Cheffromspace avatar May 20 '25 16:05 Cheffromspace