Skip to content

Conversation

@vax-r
Copy link
Contributor

@vax-r vax-r commented Dec 21, 2025

Summary

Implement allow-env and block-env option for limactl shell command, which is equivalent of setting
environment variable "LIMA_SHELLENV_ALLOW" and
"LIMA_SHELLENV_BLOCK".

Related issue

#4263

shellCmd.Flags().Bool("reconnect", false, "Reconnect to the SSH session")
shellCmd.Flags().Bool("preserve-env", false, "Propagate environment variables to the shell")
shellCmd.Flags().Bool("start", false, "Start the instance if it is not already running")
shellCmd.Flags().String("allow-env", "", "Comma-separated list of environment variable patterns to allow when --preserve-env is set (overrides LIMA_SHELLENV_ALLOW)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkihiroSuda AkihiroSuda added this to the v2.1.0 milestone Dec 21, 2025
@AkihiroSuda AkihiroSuda added the area/cli limactl CLI user experience label Dec 21, 2025
@vax-r vax-r force-pushed the shell_option branch 2 times, most recently from f662f04 to 124a66f Compare December 27, 2025 07:40
Implement allow-env and block-env option for limactl
shell command, which is equivalent of setting
environment variable "LIMA_SHELLENV_ALLOW" and
"LIMA_SHELLENV_BLOCK".

Except that "allow-env" and "block-env" are treated as
StringSlice rather than pure string in these options.

Related issue: lima-vm#4263

Signed-off-by: I Hsin Cheng <[email protected]>
@vax-r
Copy link
Contributor Author

vax-r commented Dec 27, 2025

@AkihiroSuda
Thanks for your review and suggestion !
I've done the changes you mentioned and use StringSlice() instead of string.
Let me know if anything needs to be added or changes.

Btw, the test starting WSL2 seems to fail, I've read the log I don't think it's triggered by this commit change?

@vax-r vax-r requested a review from AkihiroSuda December 27, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli limactl CLI user experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants