fix: 添加后台执行设置以防止进程阻塞

This commit is contained in:
TsMask
2025-05-29 17:15:15 +08:00
parent dbc1b59807
commit da5ef0725a

View File

@@ -15,8 +15,7 @@ func NewClientSession(cols, rows int) (*LocalClientSession, error) {
c := exec.Command("bash")
// 为防止当前进程阻塞,设置为后台执行
c.SysProcAttr = &syscall.SysProcAttr{
HideWindow: true, // 隐藏窗口
NoInheritHandles: true, // 不继承句柄
Setpgid: true, // 设置新进程组,确保安装进程与当前进程不在同一进程组
}
// Start the command with a pty.
ptmx, err := pty.StartWithSize(c, &pty.Winsize{