Skip to content

Commit 24cb22b

Browse files
authored
Merge pull request #1918 from cwegener/master
fix: Ctrl-C does not interrupt create prompt
2 parents c4986e7 + 973cccd commit 24cb22b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/limactl/start.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strings"
1212

1313
"github.com/AlecAivazis/survey/v2"
14+
"github.com/AlecAivazis/survey/v2/terminal"
1415
"github.com/containerd/containerd/identifiers"
1516
"github.com/lima-vm/lima/cmd/limactl/editflags"
1617
"github.com/lima-vm/lima/cmd/limactl/guessarg"
@@ -376,6 +377,9 @@ func chooseNextCreatorState(st *creatorState, yq string) (*creatorState, error)
376377
},
377378
}
378379
if err := survey.AskOne(prompt, &ans); err != nil {
380+
if err == terminal.InterruptErr {
381+
logrus.Fatal("Interrupted by user")
382+
}
379383
logrus.WithError(err).Warn("Failed to open TUI")
380384
return st, nil
381385
}

0 commit comments

Comments
 (0)