gum icon indicating copy to clipboard operation
gum copied to clipboard

Unhandled trailing newline from stdin in `gum input`

Open pbsds opened this issue 1 year ago • 0 comments

Describe the bug

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

To Reproduce

  • trailing whitespace: echo foo | gum input
  • no trailing whitespace: gum input --value="$(echo foo)"

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:

  • OS: Manjaro and NixOS

pbsds avatar May 10 '24 09:05 pbsds