#1109·gum

"gum log" does not preserve newlines in text

Author: larsksCreated Jul 31, 2026Updated Jul 31, 2026

Description

I was hoping to replace echo in a script with gum log, but given a string with newlines, like this:

example="this
is
a
test
"

Running echo "$example" produces:

this
is
a
test

While running gum log "$example" produces:

thisisatest

This was surprising given gum log's obvious use as a replacement for echo in shell scripts.

Version

gum version v0.17.0

Environment

fedora 44 + foot + tmux