Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mise en #1655

Open
jdx opened this issue Feb 11, 2024 · 6 comments
Open

mise en #1655

jdx opened this issue Feb 11, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@jdx
Copy link
Owner

jdx commented Feb 11, 2024

I had an idea reading rvm's documentation and its similar (but not the same as what I'm proposing here) as their rvm in command.

We already have support for rvm in with mise -C some/dir x but I have been thinking lately that people would probably benefit from a convenient way to perform mise x -- $SHELL—which gives you a nice way to launch into the mise environment without needing to use mise activate in your shell rc file—notably the way I like to use mise. I think in places like IDEs it can often be a lot easier to set things up this way as well.

I'm thinking mise en could be a nice shorthand for that, so you could just do mise en . and it would be effectively like doing cd . but it'll setup all of your tools and everything.

Of course this doesn't enable anything new since you can just run mise -C some/dir x -- $SHELL and it does the same thing (perhaps via a mise_en alias), but having a top-level command is a good way to teach people how best to use mise and I think this is a pattern a lot of people would benefit from knowing about.

@jdx jdx added the enhancement New feature or request label Feb 11, 2024
@booniepepper
Copy link
Contributor

Poetry has a similar thing with poetry shell that launches your current shell but with a (poetry-managed) virtual env activated.

For more ideas, see also Nix's nix-shell (spawn shell from nix file) and nix shell (spawn shell from cli args)

@booniepepper
Copy link
Contributor

Also strongly suggesting it should be mise en .

@jdx
Copy link
Owner Author

jdx commented Feb 22, 2024

I think this would be fairly easy to implement if anyone wants to have at it, I think we can just call Exec::run() from a new CLI command with "$SHELL" after changing the current directory

@jdx jdx changed the title mise in mise en Feb 22, 2024
@pepicrft
Copy link
Contributor

I like the idea. When using it from Xcode project scripts it'd just be one line of code. I'd check if it works fine with sandbox-env, which is the tool that Xcode uses to sandbox the execution of the script.

I'm not Xcode developers will entirely understand what the command is for, but the copy and pasting that they'll most likely do has more chances to work.

Have you considered mise shell? As someone not familiar with rvm in, I wouldn't be able to guess what the command is for.

@jdx
Copy link
Owner Author

jdx commented Feb 22, 2024

well, we already have a command mise shell. It's a bit different though in that it only works inside of a session where mise activate has already been executed.
I thought for a bit maybe we could merge the 2 and have mise shell do the same thing as mise en if it's not inside of a mise activate session, but I think they work so differently that it makes more sense to have separate commands.

@pepicrft
Copy link
Contributor

Naming is hard 😬. I'd expect mise shell to take the role of mise en, and the current mise shell to be more like mise load/set to mean that a tool is being loaded into the activated session.

jdx added a commit that referenced this issue Feb 23, 2024
@jdx jdx linked a pull request Feb 23, 2024 that will close this issue
jdx added a commit that referenced this issue Feb 23, 2024
jdx added a commit that referenced this issue Feb 23, 2024
jdx added a commit that referenced this issue Feb 23, 2024
jdx added a commit that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants