Make MISE_ENV a setting #3989
Replies: 4 comments 5 replies
-
Yeah, I'd like this too — for example, we can have a shared project that has a few different |
Beta Was this translation helpful? Give feedback.
-
I’m also interested in this. On mise running under the Fish shell, it sort of works, but shows some odd behavior:
When I did a quick test with Bash, it seemed to work fine, so I’m not really sure. It might behave differently depending on the shell. |
Beta Was this translation helpful? Give feedback.
-
i was hoping |
Beta Was this translation helpful? Give feedback.
-
just to set expectations: I think this is a bad idea. By "bad" I don't mean that I don't see the value (I certainly do), but that I don't think it's realistic. I doubt I will ever look into supporting it and I would advise against even trying to figure out how this could work. Even if we had such functionality I would caution against using it because it would certainly result in strange behavior and bugs even in the best of situations. To understand why, you need to think about how mise works. mise first does a pass to figure out which config files it will load, then it loads all of them in parallel. What you're asking for is a way to have something in a file have some way of modifying which files would have been loaded which is a paradox. I'm sure people won't like my response here but really I think you're asking for something that just isn't realistic. It's not that I don't see the value in having this, it's that I have no idea how any solution could possibly work—at least not without glaring edge-cases or complex documentation prescribing how it would need to be used. You're welcome to try to prove me wrong of course, I'm willing to be persuaded. I don't think it's likely a good use of your time though. Settings could in theory do this because the config files actually get loaded twice, once for settings and once for config files. However this would mean the config files used for settings would be different than those used for config files. While technically that would solve some of these use cases it's bizarre behavior that would need to be clearly documented and on those grounds alone I would prefer to just keep things simpler and not do it at all. Yes there are ways this could be solved by doing things like having multiple passes of loading config files or having things run in series but in those cases you'll have complications related to the order things are parsed. It's going to be very complicated. I do not think it's worth it. The example above of using My guidance is that you should not try to use mise to configure the way mise loads config files inside of config files. I hope you can see from that sentence alone why it doesn't make sense. Taken strictly, what if a config file said that it should load itself? Or not itself? This means don't try to use it for settings like I've recently started adding documentation to the settings around these clarifying which configuration only works as an env var. If you see that, it's likely not because mise needs to do more work to support using them as a setting, it's because using an env var is the only way that particular setting actually makes sense with the way mise works under the hood. I would prefer not to discuss this anymore but I suspect people will come to me with ideas. In my experience this usually results in ideas that solve one part of the solution but not another. I'll read whatever people write here but unless you present a full solution that truly does capture all the problems—or at least close enough to that—I likely won't engage with this anymore. |
Beta Was this translation helpful? Give feedback.
-
I want to be able to set
MISE_ENV
when entering a project directory.To do this today I need to export
MISE_ENV
every time I create a new shell.Setting it in my shells profile is not an option for me, as I might have different
MISE_ENV
s for dirrerent projects at the same time.If
MISE_ENV
was a settnig them I could set it in my mainmise.toml
in each project and it would just work™If
MISE_ENV
is set in the environment then this should tage precedence over the config value.Beta Was this translation helpful? Give feedback.
All reactions