Skip to content

Commit

Permalink
Send interupt on Close on Linux
Browse files Browse the repository at this point in the history
Updates #19
  • Loading branch information
bep committed Jun 8, 2023
1 parent 5856bf0 commit 0d7a52f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import (
"bytes"
"errors"
"io"
"os"
"os/exec"
"regexp"
"runtime"
"time"
)

Expand Down Expand Up @@ -57,6 +59,10 @@ func (c conn) Start() error {
func (c conn) Close() error {
writeErr := c.WriteCloser.Close()
readErr := c.readerCloser.Close()
if runtime.GOOS == "linux" {
// See https://github.com/bep/godartsass/issues/19
c.cmd.Process.Signal(os.Interrupt)
}
cmdErr := c.waitWithTimeout()

if writeErr != nil {
Expand Down

0 comments on commit 0d7a52f

Please sign in to comment.