Fix :pipe -b actually writing to stdin
This commit is contained in:
parent
133085b436
commit
3f30c27bb3
1 changed files with 9 additions and 1 deletions
|
@ -86,7 +86,15 @@ func (_ Pipe) Execute(aerc *widgets.Aerc, args []string) error {
|
||||||
|
|
||||||
doExec := func(reader io.Reader) {
|
doExec := func(reader io.Reader) {
|
||||||
ecmd := exec.Command(cmd[0], cmd[1:]...)
|
ecmd := exec.Command(cmd[0], cmd[1:]...)
|
||||||
err := ecmd.Run()
|
pipe, err := ecmd.StdinPipe()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
defer pipe.Close()
|
||||||
|
io.Copy(pipe, reader)
|
||||||
|
}()
|
||||||
|
err = ecmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
aerc.PushStatus(" "+err.Error(), 10*time.Second).
|
aerc.PushStatus(" "+err.Error(), 10*time.Second).
|
||||||
Color(tcell.ColorDefault, tcell.ColorRed)
|
Color(tcell.ColorDefault, tcell.ColorRed)
|
||||||
|
|
Loading…
Reference in a new issue