diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-07-08 18:50:40 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-07-08 18:50:40 -0400 |
commit | 3f30c27bb31f26ca639b7a87d54a7c522bbe8be0 (patch) | |
tree | 3564465d137623f502dd256f0b6565eac02ccdad /commands/msg | |
parent | 133085b436f56bdd48fb1aba1184811b3a278d3c (diff) |
Fix :pipe -b actually writing to stdin
Diffstat (limited to 'commands/msg')
-rw-r--r-- | commands/msg/pipe.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index 6f8c616..9f4a009 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -86,7 +86,15 @@ func (_ Pipe) Execute(aerc *widgets.Aerc, args []string) error { doExec := func(reader io.Reader) { 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 { aerc.PushStatus(" "+err.Error(), 10*time.Second). Color(tcell.ColorDefault, tcell.ColorRed) |