Skip to content

Local defaults for --tty and other command line options #2994

Open
@nirs

Description

@nirs

Description

My workflow is:

  1. Create a lima yaml, usually for testing something, by copying another yaml and editing it. I want to keep the yaml around for creating more vms later, maybe put in in version control.

  2. Create the vm from the yaml

I never want to edit the yaml during creation, but I forget to add --tty=0 a lot. Editing the yaml means your changes are saved only in ~/.lima/name/lima.yaml, and I like to treat anything under ~/.lima as ephemeral.

It would be useful if --tty=false was the default, but this may not be best for everyone. Having a local default will make it easy to adapt lima to different users. This option name is also not great, it should be about editing the yaml, not about using in a terminal.

Current behavior is to default to tty=true when using in a terminal:

rootCmd.PersistentFlags().Bool("tty", isatty.IsTerminal(os.Stdout.Fd()), "Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation.")

We can change it to:

  • read a configuration file (e.g. ~/.lima/_config/local.yaml)
  • consider the local default for tty and the terminal capabilities

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/clilimactl CLI user experienceenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions