fix: wsl shutdown command not working on newer WSL versions (#2040)

This commit is contained in:
aby913 2025-11-06 17:54:13 +08:00 committed by GitHub
parent df2b5b4274
commit a0e8a69848
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -314,7 +314,7 @@ func (c *ConfigWslConf) Execute(runtime connector.Runtime) error {
}
cmd = &utils.DefaultCommandExecutor{
Commands: []string{"--shutdown", distro},
Commands: []string{"-t", distro},
}
if _, err := cmd.RunCmd("wsl", utils.DEFAULT); err != nil {
return errors.Wrap(errors.WithStack(err), fmt.Sprintf("shutdown wsl %s failed", distro))