mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-05-22 10:15:43 +02:00
8a1f965e64
Bumps [github.com/creack/pty](https://github.com/creack/pty) from 1.1.11 to 1.1.24. - [Release notes](https://github.com/creack/pty/releases) - [Commits](https://github.com/creack/pty/compare/v1.1.11...v1.1.24) --- updated-dependencies: - dependency-name: github.com/creack/pty dependency-version: 1.1.24 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
26 lines
670 B
Go
26 lines
670 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package pty
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
// StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
|
|
// and c.Stderr, calls c.Start, and returns the File of the tty's
|
|
// corresponding pty.
|
|
//
|
|
// This will resize the pty to the specified size before starting the command.
|
|
// Starts the process in a new session and sets the controlling terminal.
|
|
func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) {
|
|
if cmd.SysProcAttr == nil {
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
|
}
|
|
cmd.SysProcAttr.Setsid = true
|
|
cmd.SysProcAttr.Setctty = true
|
|
return StartWithAttrs(cmd, ws, cmd.SysProcAttr)
|
|
}
|