1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-17 01:42:45 +02:00
This commit is contained in:
Jesse Duffield
2021-04-03 20:30:18 +11:00
parent d5a5633771
commit be2bf77bf0
4 changed files with 33 additions and 3 deletions

View File

@ -315,18 +315,27 @@ func runLazygit(t *testing.T, testPath string, rootDir string, record bool, spee
cmd.Stdin = os.Stdin
cmd.Stderr = os.Stderr
cmd.Env = append(
cmd.Env,
os.Environ(),
fmt.Sprintf("RECORD_EVENTS_TO=%s", replayPath),
"TERM=xterm-256color",
)
} else {
cmd.Stdout = os.Stdout
cmd.Stdin = os.Stdin
cmd.Stderr = os.Stderr
cmd.Env = append(
cmd.Env,
os.Environ(),
fmt.Sprintf("REPLAY_EVENTS_FROM=%s", replayPath),
"TERM=xterm-256color",
)
t.Log(cmd.Env)
}
t.Log("here")
// if we're on CI we'll need to use a PTY. We can work that out by seeing if the 'TERM' env is defined.
if runInPTY() {
t.Log("1")
cmd.Env = append(cmd.Env, "TERM=xterm")
f, err := pty.StartWithSize(cmd, &pty.Winsize{Rows: 100, Cols: 100})
@ -338,6 +347,7 @@ func runLazygit(t *testing.T, testPath string, rootDir string, record bool, spee
_ = f.Close()
} else {
t.Log("2")
err := cmd.Run()
assert.NoError(t, err)
}