Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"gum spin" does not forward STDIN to the command #266

Closed
occivink opened this issue Jan 19, 2023 · 2 comments
Closed

"gum spin" does not forward STDIN to the command #266

occivink opened this issue Jan 19, 2023 · 2 comments
Labels
bug Something isn't working cmd/spin

Comments

@occivink
Copy link

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

@johnzzon
Copy link

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"

@caarlos0 caarlos0 added bug Something isn't working cmd/spin labels Nov 18, 2024
@caarlos0
Copy link
Member

should be fixed on main, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmd/spin
Projects
None yet
Development

No branches or pull requests

3 participants