You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A:configurationIssue related to nu's configurationA:hooksHooks are used to react to changes during interactive executioncategory:bugSomething isn't working
It is not possible to set hooks in overlays using export-env.
$env.config.hooks is updated, but the hooks are not active.
How to reproduce
~> module hooks { export-env {$env.config.hooks.pre_prompt = [{|| print 1}]}}
~> overlay use hooks
~> # hook is not active
~> $env.config.hooks.pre_prompt # shows that the hook is updated
...
~> $env.config = $env.config # this reloads the hooks
1
~> # hook is now active
Expected behavior
I expect the hooks to be active immediately after updating $env.config, just like in REPL or with use
I think they all might have the same cause, which is that we have one Config in the EngineState, but we'd need a Config for each overlay. Or better, do not have the Config struct at all and use only Nushell's environment to handle config values.
A:configurationIssue related to nu's configurationA:hooksHooks are used to react to changes during interactive executioncategory:bugSomething isn't working
Activity
fdncred commentedon Nov 17, 2023
Do you get the same behavior in 0.87.0?
vladidobro commentedon Nov 17, 2023
yes, with 0.87.0 it is the same
fdncred commentedon Nov 17, 2023
Any ideas @kubouch?
kubouch commentedon Nov 17, 2023
Potentially related issues: #7760 #10592 #8856
I think they all might have the same cause, which is that we have one Config in the EngineState, but we'd need a Config for each overlay. Or better, do not have the Config struct at all and use only Nushell's environment to handle config values.
fix(hooks): updating `$env.config` now correctly updates config state. (
fix(overlay): `overlay use` and `overlay hide` now update config state (
fix(overlay): `overlay use` and `overlay hide` now update config state (