Skip to content

Commit a5e9bd5

Browse files
committed
Check tty flag also for the shell command
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 77d181a commit a5e9bd5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/limactl/shell.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func newShellCommand() *cobra.Command {
7070
func shellAction(cmd *cobra.Command, args []string) error {
7171
ctx := cmd.Context()
7272
flags := cmd.Flags()
73+
tty, err := flags.GetBool("tty")
74+
if err != nil {
75+
return err
76+
}
7377
// simulate the behavior of double dash
7478
newArg := []string{}
7579
if len(args) >= 2 && args[1] == "--" {
@@ -106,8 +110,8 @@ func shellAction(cmd *cobra.Command, args []string) error {
106110
return err
107111
}
108112

109-
if !flags.Changed("start") {
110-
startNow, err = askWhetherToStart()
113+
if tty && !flags.Changed("start") {
114+
startNow, err = askWhetherToStart(cmd)
111115
if err != nil {
112116
return err
113117
}

0 commit comments

Comments
 (0)