mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-21 00:30:00 +02:00
.devcontainer
.github
.vscode
cmd
demo
docs
pkg
app
cheatsheet
commands
git_commands
git_config
hosting_service
models
oscommands
cmd_obj.go
cmd_obj_builder.go
cmd_obj_runner.go
cmd_obj_runner_default.go
cmd_obj_runner_test.go
cmd_obj_runner_win.go
cmd_obj_test.go
copy.go
dummies.go
fake_cmd_obj_runner.go
gui_io.go
os.go
os_default_platform.go
os_default_test.go
os_test.go
os_windows.go
os_windows_test.go
patch
testdata
types
git.go
git_cmd_obj_builder.go
git_cmd_obj_runner.go
git_test.go
common
config
constants
env
fakes
gui
i18n
integration
logs
snake
tasks
theme
updates
utils
scripts
test
vendor
.gitignore
.golangci.yml
.goreleaser.yml
CODE-OF-CONDUCT.md
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
go.mod
go.sum
main.go
26 lines
512 B
Go
26 lines
512 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package oscommands
|
|
|
|
import (
|
|
"os/exec"
|
|
|
|
"github.com/creack/pty"
|
|
)
|
|
|
|
// we define this separately for windows and non-windows given that windows does
|
|
// not have great PTY support and we need a PTY to handle a credential request
|
|
func (self *cmdObjRunner) getCmdHandler(cmd *exec.Cmd) (*cmdHandler, error) {
|
|
ptmx, err := pty.Start(cmd)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &cmdHandler{
|
|
stdoutPipe: ptmx,
|
|
stdinPipe: ptmx,
|
|
close: ptmx.Close,
|
|
}, nil
|
|
}
|