Describe the bug
If you update a $env.config.hooks variable from within a export-env, which has been loaded via overlay use from the $nu.config-path it is written, but not updated/applied (it does nothing, but after writing to it again both work)
How to reproduce
prepare files for it
env.nu:
let-env config = {
hooks: {
pre_prompt: []
pre_execution: []
env_change: {}
}
)
config.nu:
test.nu:
export-env {
let-env config = ($env.config | upsert hooks.pre_execution {|config|
$config.hooks.pre_execution
| append {||
print 'TEST'
}
})
}
reproduce it
load via nu --env-config env.nu --config config.nu -> no pre-exec hook works
update the hook config again
run
let-env config = ($env.config | upsert hooks.pre_execution {|config|
$config.hooks.pre_execution
| append {||
print 'TEST-2'
}
})
-> 2 pre-exec hooks work
verify its a issue with use and not something else
mv test.nu config.nu -f
nu --env-config env.nu --config config.nu
- enter anything (trigger
pre_execution)
- it works
Expected behavior
it should work either way
Screenshots
No response
Configuration
| key |
value |
| version |
0.78.1 |
| branch |
|
| commit_hash |
|
| build_os |
linux-x86_64 |
| build_target |
x86_64-unknown-linux-gnu |
| rust_version |
rustc 1.67.1 (d5a82bbd2 2023-02-07) (built from a source tarball) |
| cargo_version |
cargo 1.67.0 |
| build_time |
1980-01-01 00:00:00 +00:00 |
| build_rust_channel |
release |
| features |
default, zip |
| installed_plugins |
|
i self-compiled it via nix (buildscript) - the commit hash is: d0a83fec693e50fbe38780aaec932f6b8cc8ed0a (newer than 0.78)
This bug has been around since at least 0.69.0 (i was to lazy to figure out the exact issue back then, but have it documented - my setup back then was based on official releases and popos & ubuntu)
Additional context
No response
Describe the bug
If you update a
$env.config.hooksvariable from within aexport-env, which has been loaded viaoverlay usefrom the$nu.config-pathit is written, but not updated/applied (it does nothing, but after writing to it again both work)How to reproduce
prepare files for it
env.nu:config.nu:overlay use test.nutest.nu:reproduce it
load via
nu --env-config env.nu --config config.nu-> no pre-exec hook worksupdate the hook config again
run
-> 2 pre-exec hooks work
verify its a issue with
useand not something elsemv test.nu config.nu -fnu --env-config env.nu --config config.nupre_execution)Expected behavior
it should work either way
Screenshots
No response
Configuration
i self-compiled it via nix (buildscript) - the commit hash is:
d0a83fec693e50fbe38780aaec932f6b8cc8ed0a(newer than 0.78)This bug has been around since at least
0.69.0(i was to lazy to figure out the exact issue back then, but have it documented - my setup back then was based on official releases and popos & ubuntu)Additional context
No response