Describe the problem
When including the newline character '\n' in the "output" string of the JSON structure generated by a script called by the recipe.advanced_size.pattern, an error message by the build process is reported. According to the documentation (https://arduino.github.io/arduino-cli/1.1/platform-specification/#recipes-to-compute-binary-sketch-size-for-more-complex-systems-since-arduino-cli-0210), it should be possible to include newline characters in the output string.
To reproduce
I assume you have installed arduino-cli, and you use Linux or macOS.
- Install TinyCore manually (see: https://github.com/MCUdude/TinyCore?tab=readme-ov-file#manual-installation).
- Load TinyCore/avr/scripts/size.sh into your editor and insert '\n' into the line
printf '{ "output": "Flash memory used: %d bytes out of %d (%d%%). ' $flash $maxflash $flashpercent after the full stop.
- Create a new sketch:
arduino-cli sketch new Blink
- Compile:
arduino-cli compile -b TinyCore:avr:x5 Blink
Compilation fails:
Used platform Version Path
TinyCore:avr 0.1.0 /Users/nebel/GitHub/TinyCore/avr
Error during build: Error while determining sketch size: invalid character '\n' in string literal
Expected behavior
Successful compilation with a two-line output about RAM and flash size.
Arduino CLI version
arduino-cli Version: nightly-20260405 Commit: da1d3eb Date: 2026-04-05T01:40:13Z
Operating system
macOS
Operating system version
15.7.4
Additional context
No response
Issue checklist
Describe the problem
When including the newline character '\n' in the "output" string of the JSON structure generated by a script called by the recipe.advanced_size.pattern, an error message by the build process is reported. According to the documentation (https://arduino.github.io/arduino-cli/1.1/platform-specification/#recipes-to-compute-binary-sketch-size-for-more-complex-systems-since-arduino-cli-0210), it should be possible to include newline characters in the output string.
To reproduce
I assume you have installed arduino-cli, and you use Linux or macOS.
printf '{ "output": "Flash memory used: %d bytes out of %d (%d%%). ' $flash $maxflash $flashpercentafter the full stop.arduino-cli sketch new Blinkarduino-cli compile -b TinyCore:avr:x5 BlinkCompilation fails:
Expected behavior
Successful compilation with a two-line output about RAM and flash size.
Arduino CLI version
arduino-cli Version: nightly-20260405 Commit: da1d3eb Date: 2026-04-05T01:40:13Z
Operating system
macOS
Operating system version
15.7.4
Additional context
No response
Issue checklist