lima icon indicating copy to clipboard operation
lima copied to clipboard

Deprecate `--tty=(false|true)` and rename it to `--auto=(true|false)`

Open AkihiroSuda opened this issue 2 years ago • 9 comments

Obviously, "tty" (TeleTYpewriter) is a misnomer.

I don't remember why I chose this name. 🤦‍♂️

AkihiroSuda avatar Sep 27 '23 06:09 AkihiroSuda

It made sense from a technical point of view.

Like "No input/output device available"

afbjorklund avatar Sep 28 '23 18:09 afbjorklund

I never quite liked the --tty option, mostly because you have to use --tty=false and not just --notty (but I don't like negated options either).

I have one issue with --auto though: I would expect it to "automatically accept the default answers" instead of prompting for input.

But that is not how --tty=false works: limactl edit will prompt you to start the instance, and will default to yes. But limactl edit --tty=false will not start the instance (so picks no).

I don't really have a suggestion, just wondering if there is another name that would more intuitively match the current behaviour (which I think is what we want).

jandubois avatar Sep 28 '23 20:09 jandubois

Just kidding:

DEBIAN_FRONTEND=noninteractive limactl edit alpine --cpus 12

jandubois avatar Sep 28 '23 20:09 jandubois

I have one issue with --auto though: I would expect it to "automatically accept the default answers" instead of prompting for input.

--auto=true will equate to the current --tty=false, and accept the default answer (not always "yes")

AkihiroSuda avatar Sep 28 '23 20:09 AkihiroSuda

--auto=true will equate to the current --tty=false, and accept the default answer (not always "yes")

That was my point above: if it behaves the same as the current --tty=false then it will not always pick the default answer.

For limactl edit the default answer is yes:

$ l edit alpine --set ".foo=1"
WARN[0000] `--set` is experimental
INFO[0000] Instance "alpine" configuration edited
? Do you want to start the instance now?  (Y/n)
FATA[0013] interrupt

But if you use --tty=false it picks the non-default answer of 'no` (it doesn't start the instance):

$ l edit alpine --set ".foo=2" --tty=false
WARN[0000] `--set` is experimental
INFO[0000] Instance "alpine" configuration edited
$

It means that either --auto will not pick the default, or we need to change the behaviour in one of the 2 cases to meet your expectation above.

To be explicit: I think the current behaviour is desirable, and we have to live with the fact that the --auto option might not pick the default. Which is what makes the name problematic to me. But maybe it is the best we can do; I don't have a better suggestion.

jandubois avatar Sep 28 '23 21:09 jandubois

As new lima user, I actually quite liked --tty. I've only discovered the option 2 days ago.

Backstory:

For the last two weeks I've been getting really annoyed with the prompt that came up every time I ran limactl start to create a new machine.

I eventually typed limactl start --help and was glad to spot the --tty option the help output. As soon as I saw that option it immediately made sense to me.

The only thing that surprised me was that the --tty option was only applicable to limactl start and none of the other commands had that option available.

It felt to me that a flag like this would be applicable to many more commands than just 1 command. But I guess the start command is a special command in that way??

cwegener avatar Sep 28 '23 21:09 cwegener

The only thing that surprised me was that the --tty option was only applicable to limactl start and none of the other commands had that option available.

limactl edit and limactl create have that flag too.

(But anyway we should make it a global flag)

AkihiroSuda avatar Sep 28 '23 21:09 AkihiroSuda

From my understanding we're talking about command being interactive or non-interactive.. I'm pretty fine with docker/kubectl -i option for this. Though in our case it should be negated by default, so maybe --batch or --non-interactive..

--auto is confusing for me because I don't understand what does it mean w/o reading the help/manual..

jay7x avatar Sep 29 '23 06:09 jay7x

--auto is confusing for me because I don't understand what does it mean w/o reading the help/manual..

100% agree. --auto is completely meaningless and way worse that --tty

cwegener avatar Sep 29 '23 22:09 cwegener