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

Komondor blocking user-interactivity? #22

Open
mikehobi opened this issue Aug 9, 2019 · 3 comments
Open

Komondor blocking user-interactivity? #22

mikehobi opened this issue Aug 9, 2019 · 3 comments

Comments

@mikehobi
Copy link

mikehobi commented Aug 9, 2019

Hello, I believe I have a potential bug report or just a general question.

I'm trying to have a pre-commit hook that is interactive, here is a basic example:

#!/bin/sh

exec </dev/tty

while read -p "Looks like you are committing directly to master, are you sure you want to continue? (Y/n) " yn; do
  case $yn in
  [Yy]) break ;;
  [Nn])
    echo "Good call. Make a new branch."
    exit 1
    ;;
  *) echo "Please answer y (yes) or n (no):" && continue ;;
  esac
done

exec <&-

Anyways. This script works fine when entered manually to .git/hooks/pre-commit, but does not work correctly when using Komondor. It doesn't display any message, and does not respond to any text:

> ./bin/verify-commit

Please let me know if there's a workaround to this issue.

@orta
Copy link
Member

orta commented Aug 9, 2019

Yeah, that sounds like a bug 👍 - I'd look to see if the process Komondor opens to run the shell includes STDIN

@mikehobi
Copy link
Author

Looks like Komondor is using ShellOut to handle that. Seems like it could be an issue with that library?

@orta
Copy link
Member

orta commented Aug 12, 2019

Looks like no-one has ever asked about it:https://github.com/JohnSundell/ShellOut/issues?utf8=✓&q=stdin+

Could either move the useful bits into Komondor, or add stdin support to shellout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants