Komondor icon indicating copy to clipboard operation
Komondor copied to clipboard

Komondor blocking user-interactivity?

Open mikehobi opened this issue 5 years ago • 3 comments

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.

mikehobi avatar Aug 09 '19 21:08 mikehobi

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

orta avatar Aug 09 '19 23:08 orta

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

mikehobi avatar Aug 12 '19 17:08 mikehobi

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

orta avatar Aug 12 '19 17:08 orta