Environment plugins run far too eagerly #8602
Replies: 1 comment
-
|
This is expected behavior but there are ways to improve it. Here's what's happening: Why it runs so oftenEvery shell prompt: Multiple times before a task: The env module gets evaluated in two phases:
Plus After How to reduce executions1. Enable env caching (recommended)Add to your [settings]
env_cache = true
# env_cache_ttl = "1h" # default, adjust as neededThen in your plugin's function PLUGIN:MiseEnv(ctx)
return {
cacheable = true,
watch_files = {"path/to/config/that/would/change/results"},
env = {
{ key = "MY_VAR", value = "my_value" }
}
}
endWith caching enabled, the plugin only re-runs when watched files change or the TTL expires. 2. Use
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Something that I have seemed to notice (on both windows and linux) is that environment plugins seem to run very eagerly. Perhaps this is a configuration issue of my particular plugin, but it runs for every command I invoke, not just
misecommands (while writing I realised I guess this makes sense, but sometimes that means it runs out of order which can be annoying), it runs 4 times before any mise task is executed (I have an info log inside the plugin that prints 4 times before the tasks starts), and it also seems to execute after any mise command has been executed as well (for example,mise envwill run the plugin once, then print the environment variables, then run it again).Again, this may be a configuration issue on my part, but I'd love to know how I can stop environment plugins from running so many times.
version: 2026.3.9 windows-x64 (2026-03-13) shims_on_path: yes self_update_available: yesmise doctorbuild_info:
Target: x86_64-pc-windows-msvc
Features: DEFAULT, NATIVE_TLS, OPENSSL, RUSTLS_NATIVE_ROOTS, SELF_UPDATE
Built: Fri, 13 Mar 2026 19:08:15 +0000
Rust Version: rustc 1.93.1 (01f6ddf75 2026-02-11)
Profile: release
shell:
pwsh
PowerShell 7.5.4
aqua:
baked in registry tools: 2259
dirs:
cache: D:\Dexter\AppData\Local\Temp\mise
config: ~.config\mise
data: ~\AppData\Local\mise
shims: ~\AppData\Local\mise\shims
state: ~.local\state\mise
config_files:
~.config\mise\config.toml
ignored_config_files: (none)
backends:
aqua
asdf
cargo
conda
core
dotnet
forgejo
gem
github
gitlab
go
npm
pipx
spm
http
s3
ubi
vfox
plugins:
toolset:
core:node@25.8.1
core:python@3.14.3
path:
C:\Program Files\PowerShell\7
D:\Program Files\Zulu\zulu-21\bin
D:\Program Files (x86)\VMware\VMware Player\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0
C:\WINDOWS\System32\OpenSSH
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
D:\Program Files\npm
D:\Program Files\spwn
D:\Program Files\BinDiff\bin
C:\Program Files\usbipd-win
C:\Program Files\dotnet
D:\Programs\Scoop\Apps\apps\gpg4win\current\Gpg4win..\GnuPG\bin
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit
C:\Program Files\NVIDIA Corporation\NVIDIA App\NvDLISR
C:\Program Files\PowerShell\7
D:\Programs\Scoop\Apps\shims
D:\Dexter.cargo\bin
~\scoop\shims
~\AppData\Local\mise\installs\infisical\0.43.58
C:\Program Files\PowerShell\7
D:\Program Files\Zulu\zulu-21\bin
D:\Program Files (x86)\VMware\VMware Player\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0
C:\WINDOWS\System32\OpenSSH
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
D:\Program Files\npm
D:\Program Files\spwn
D:\Program Files\BinDiff\bin
C:\Program Files\usbipd-win
C:\Program Files\dotnet
D:\Programs\Scoop\Apps\apps\gpg4win\current\Gpg4win..\GnuPG\bin
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit
C:\Program Files\NVIDIA Corporation\NVIDIA App\NvDLISR
C:\Program Files\PowerShell\7
D:\Programs\Scoop\Apps\apps\llvm\current\bin
D:\Programs\Scoop\Apps\apps\gpg4win\current\GnuPG\bin
D:\Programs\Scoop\Apps\apps\gpg4win\current\Gpg4win\bin
D:\Programs\Scoop\Apps\apps\mpv\current
~\AppData\Local\pnpm
D:\Programs\Scoop\Apps\apps\nvm\current
D:\Programs\Scoop\Apps\apps\nvm\current\nodejs\n
~\AppData\Local\mise\installs\node\25.8.1
~\AppData\Local\mise\installs\python\3.14.3
~\AppData\Local\mise\shims
C:\WINDOWS\System32\WindowsApps
~\AppData\Local\Microsoft\WindowsApps
D:\Dexter\AppData\Local\Programs\Microsoft VS Code\bin
D:\Programs\Scoop\Apps\apps\git\current\bin
~\AppData\Local\Microsoft\WinGet\Links
env_vars:
MISE_SHELL=pwsh
settings:
experimental false ~.config\mise\config.toml
No problems found
Beta Was this translation helpful? Give feedback.
All reactions