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

[Bug]: Piping in command substitution does not work #1106

Open
1 task done
damejeras opened this issue Nov 2, 2024 · 0 comments
Open
1 task done

[Bug]: Piping in command substitution does not work #1106

damejeras opened this issue Nov 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@damejeras
Copy link

damejeras commented Nov 2, 2024

What happened?

I have been using fabric in my zsh function

# Assistant
function _assist() {
  output=$(echo -n "$@" | fabric --pattern shell_command)
  echo "$output"
  vared -p "Do you want to evaluate the command? (y/n) " -c choice
  if [[ $choice == y ]]; then
    eval "$output"
  fi
  print -s "$output"  # Add the command to history
}

It was working on my old setup (not sure which version of fabric I was using previously), but I installed @latest through go install and it doesn't work anymore. If I run my function I get the response to my prompt telling that the input was not provided. I was debugging the issue and it seems that echo output does not get piped to fabric. If I run this without command substitution ($(...)) it works as expected. I believe there is a bug in how fabric handles pipes within command substitutions.

Version check

  • Yes I was.

Relevant log output

No response

Relevant screenshots (optional)

No response

@damejeras damejeras added the bug Something isn't working label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant