gum icon indicating copy to clipboard operation
gum copied to clipboard

"gum spin" does not forward STDIN to the command

Open occivink opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. For example the following does not work as expected: gum spin --show-output -- cat < some-file echo "abc" | gum spin --show-output -- cat Both commands have no output, even though one would expect to see respectively the content of some-file, and abc

Describe the solution you'd like gum spin should forward the data received on stdin to the program being run. Much like env does, for example with echo abc | env cat.

Describe alternatives you've considered I can't an applicable alternative solution.

Additional context N/A

occivink avatar Jan 19 '23 10:01 occivink

I had this issue as well. It's because shell input redirection (the <) tries to apply to the whole command, so it redirects to gum. You need to do a subshell, like this:

gum spin --show-output -- sh -c "cat < some-file"

johnzzon avatar May 29 '24 04:05 johnzzon

should be fixed on main, thanks!

caarlos0 avatar Dec 10 '24 14:12 caarlos0