1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-23 21:51:07 +02:00

38 lines
551 B
Go
Raw Normal View History

2021-09-16 21:38:43 +08:00
//go:build !windows
// +build !windows
package oscommands
import (
"io"
"os/exec"
2019-02-16 10:18:38 +11:00
2020-03-25 10:37:10 +01:00
"github.com/creack/pty"
)
func RunCommandWithOutputLiveWrapper(
c *OSCommand,
cmdObj ICmdObj,
writer io.Writer,
output func(string) string,
) error {
return RunCommandWithOutputLiveAux(
c,
cmdObj,
writer,
output,
func(cmd *exec.Cmd) (*cmdHandler, error) {
ptmx, err := pty.Start(cmd)
if err != nil {
return nil, err
}
return &cmdHandler{
stdoutPipe: ptmx,
stdinPipe: ptmx,
close: ptmx.Close,
}, nil
},
)
2018-11-06 20:24:10 +01:00
}