Skip to content

Commit

Permalink
bugfix for lock versions on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
moqsien committed Nov 12, 2024
1 parent 71b98ad commit 8314f22
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions internal/terminal/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ func GetTerminalSize() (height, width int, err error) {
}

func RunTerminal() {
// already run a terminal.
if os.Getenv(sh.VMDisableEnvName) != "" {
return
}

var command string
if runtime.GOOS == gutils.Windows {
pp, _ := process.NewProcess(int32(os.Getppid()))
Expand All @@ -129,9 +134,12 @@ func RunTerminal() {
command = shell
}
}
if runtime.GOOS != gutils.Windows {
os.Setenv(sh.VMDisableEnvName, "111")
}

// if runtime.GOOS != gutils.Windows {
// os.Setenv(sh.VMDisableEnvName, "111")
// }
os.Setenv(sh.VMDisableEnvName, "111")

if command != "" {
cmd := exec.Command(command)
cmd.Env = os.Environ()
Expand Down

0 comments on commit 8314f22

Please sign in to comment.