Skip to content

Commit

Permalink
Fix lefthook capturing stdin from terminal even if when non-interacti…
Browse files Browse the repository at this point in the history
…ve and not using stdin

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 23, 2024
1 parent 1af059d commit ecff8b8
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 ecff8b8

Please sign in to comment.