1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-12 11:30:07 +08:00
2022-08-17 09:37:30 +08:00

24 lines
379 B
Go

package binary
import (
"io"
"os"
"os/exec"
"github.com/1Panel-dev/1Panel/global"
)
func StartTTY() {
cmd := "gotty"
params := []string{"--permit-write", "bash"}
go func() {
c := exec.Command(cmd, params...)
c.Env = append(c.Env, os.Environ()...)
c.Stdout = io.Discard
c.Stderr = io.Discard
if err := c.Run(); err != nil {
global.LOG.Error(err)
}
}()
}