Preserve newlines in command args

Closes: #8234

This fix works by parsing each line of input sperately then recombing.