@@ -240,9 +240,7 @@ export function parseCommand(command: string): string[] {
240240
241241 // First, protect newlines inside quoted strings by replacing them with placeholders
242242 // This prevents splitting multi-line quoted strings (e.g., git commit -m "multi\nline")
243- const newlinePlaceholder = "___NEWLINE_IN_QUOTE___"
244- const carriageReturnPlaceholder = "___CR_IN_QUOTE___"
245- const protectedCommand = protectNewlinesInQuotes ( command , newlinePlaceholder , carriageReturnPlaceholder )
243+ const protectedCommand = protectNewlinesInQuotes ( command , NEWLINE_PLACEHOLDER , CARRIAGE_RETURN_PLACEHOLDER )
246244
247245 // Split by newlines (handle different line ending formats)
248246 // This regex splits on \r\n (Windows), \n (Unix), or \r (old Mac)
@@ -261,8 +259,8 @@ export function parseCommand(command: string): string[] {
261259 // Restore newlines and carriage returns in quoted strings
262260 return allCommands . map ( ( cmd ) =>
263261 cmd
264- . replace ( new RegExp ( newlinePlaceholder , "g" ) , "\n" )
265- . replace ( new RegExp ( carriageReturnPlaceholder , "g" ) , "\r" ) ,
262+ . replace ( new RegExp ( NEWLINE_PLACEHOLDER , "g" ) , "\n" )
263+ . replace ( new RegExp ( CARRIAGE_RETURN_PLACEHOLDER , "g" ) , "\r" ) ,
266264 )
267265}
268266
0 commit comments