charmbracelet / gum

A tool for glamorous shell scripts 🎀
MIT License
17.94k stars 339 forks source link

Unhandled trailing newline from stdin in `gum input` #573

Closed pbsds closed 4 months ago

pbsds commented 4 months ago

Describe the bug

echo foo | gum input gives you a input prompt where the starting value has trailing whitespace.

To Reproduce

Expected behavior

The final trailing newline from stdin should be filtered. The posix standard stated that all text files (and thus in turn stdout) must feature a trailing newline, and tools should respect this.

Desktop: