Skip to content

Commit 4a4a3dd

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

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] == "--" {
@@ -100,8 +104,8 @@ func shellAction(cmd *cobra.Command, args []string) error {
100104
return err
101105
}
102106

103-
if !flags.Changed("start") {
104-
startNow, err = askWhetherToStart()
107+
if tty && !flags.Changed("start") {
108+
startNow, err = askWhetherToStart(cmd)
105109
if err != nil {
106110
return err
107111
}

0 commit comments

Comments
 (0)