Skip to content

Commit

Permalink
fix: don't capture STDIN without interactive or use_stdin options (#638)
Browse files Browse the repository at this point in the history
If I'm reading the code, this `args.in` should be a nullReader when
non-interactive and not using stdin. For some reason though, it ends up
capturing stdin. That is, any typing you do while lefthook is running
goes to lefthook, instead of the shell invoking it.

Fixes #588
  • Loading branch information
technicalpickles committed Feb 26, 2024
1 parent 50561a3 commit 60df434
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions internal/lefthook/run/exec/execute_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ func (e CommandExecutor) execute(ctx context.Context, cmdstr string, args *execu

defer func() { _ = p.Close() }()

go func() { _, _ = io.Copy(p, args.in) }()

_, _ = io.Copy(args.out, p)
}

Expand Down

0 comments on commit 60df434

Please sign in to comment.