MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / joinContinuationLines

Function joinContinuationLines

src/utils/bash/bashPipeCommand.ts:283–294  ·  view source on GitHub ↗

* Joins shell continuation lines (backslash-newline) into a single line. * Only joins when there's an odd number of backslashes before the newline * (the last one escapes the newline). Even backslashes pair up as escape * sequences and the newline remains a separator.

(command: string)

Source from the content-addressed store, hash-verified

281 * sequences and the newline remains a separator.
282 */
283function joinContinuationLines(command: string): string {
284 return command.replace(/\\+\n/g, match => {
285 const backslashCount = match.length - 1 // -1 for the newline
286 if (backslashCount % 2 === 1) {
287 // Odd number: last backslash escapes the newline (line continuation)
288 return '\\'.repeat(backslashCount - 1)
289 } else {
290 // Even number: all pair up, newline is a real separator
291 return match
292 }
293 })
294}

Callers 1

rearrangePipeCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected