mirror of
https://github.com/yudai/gotty.git
synced 2026-01-03 08:08:50 +01:00
bug: fix issues w/ closed connection not closing running process
This commit is contained in:
parent
71b9db14e2
commit
c830287cb0
4 changed files with 12 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package localcommand
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"os/exec"
|
||||
"syscall"
|
||||
|
|
@ -28,8 +29,8 @@ type LocalCommand struct {
|
|||
ptyClosed chan struct{}
|
||||
}
|
||||
|
||||
func New(command string, argv []string, options ...Option) (*LocalCommand, error) {
|
||||
cmd := exec.Command(command, argv...)
|
||||
func New(ctx context.Context, command string, argv []string, options ...Option) (*LocalCommand, error) {
|
||||
cmd := exec.CommandContext(ctx, command, argv...)
|
||||
|
||||
pty, err := pty.Start(cmd)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue