{"version":19,"agent":"pinch","message":"A body read from a file goes up with LF line endings\n\n--comment-file, --description-file and the other -file flags sent a file's text as it was on disk. A file saved on Windows has CRLF line endings, and the Issues server refuses a carriage return as a character a reader can't see, so a comment written in a Windows editor was refused. The text now goes up with LF only, as typed text does. A test reads a file with Windows line endings.","time":1791524995263,"timeIso":"2026-10-09T05:49:55.263Z","changes":2,"change":214,"files":["client/src/body-files.ts","client/test/body-files.test.ts"],"draft":null,"diff":[{"path":"client/src/body-files.ts","added":3,"removed":1,"diff":"--- a/client/src/body-files.ts\n+++ b/client/src/body-files.ts\n@@ -55,7 +55,9 @@\n \t\t\t\tthrow new UsageError(`--${flag} ${path}: no such file to read`);\n \t\t\t}\n \t\t}\n-\t\ttext = text.replace(/\\r?\\n$/, \"\");\n+\t\t// A file saved on Windows has CRLF line endings; the text goes up with LF only, as typed text does\n+\t\t// (the Issues Worker refuses a carriage return as a character a reader can't see).\n+\t\ttext = text.replace(/\\r\\n?/g, \"\\n\").replace(/\\n$/, \"\");\n \t\tif (text.trim() === \"\") throw new UsageError(`--${flag} ${path}: the text is empty`);\n \t\treturn text;\n \t};"},{"path":"client/test/body-files.test.ts","added":3,"removed":2,"diff":"--- a/client/test/body-files.test.ts\n+++ b/client/test/body-files.test.ts\n@@ -11,8 +11,9 @@\n \n const dir = mkdtempSync(join(tmpdir(), \"abso-body-\"));\n after(() => rmSync(dir, { recursive: true, force: true }));\n-const BODY = \"First line:\\n\\n- one\\n- two\\r\\n\\nLast line.\";\n-writeFileSync(join(dir, \"body.md\"), `${BODY}\\n`);\n+const BODY = \"First line:\\n\\n- one\\n- two\\n\\nLast line.\";\n+// Written with one Windows line ending inside, which arrives as LF.\n+writeFileSync(join(dir, \"body.md\"), `${BODY.replace(\"- two\\n\", \"- two\\r\\n\")}\\r\\n`);\n writeFileSync(join(dir, \"empty.md\"), \"\\n  \\n\");\n \n const ISSUE = { comment: \"string\", description: \"string\", title: \"string\", drop: \"boolean\" } as const;"}],"ci":null}