Auto overlay set PWD Variable error
Open
Nobody has claimed this yet.
A:hooks
status:needs-triage
- Dominant language
- Rust
- Stars
- 40.5k
- Forks
- 2.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 85
Description
Describe the bug
Auto overlay set PWD Variable error
How to reproduce
- Define config
let-env config = ($env.config | upsert hooks.env_change.PWD [
{
condition: {|_, after|
($after | path join mod.nu | path exists )
}
code: "overlay use mod.nu;let-env overlay_path = ($after);let-env PROMPT_INDICATOR = $'(ansi purple_bold)($after | path basename)(ansi reset) > '"
}
{
condition: {|before, after|
($before != null and $after != null and $env.overlay_path not-in $after
and $env.overlay_path in $before
and 'mod' in (overlay list))
}
code: "overlay hide mod --keep-env [ PWD ];let-env PROMPT_INDICATOR = ''"
}
])
- Create mod.nu file.
- Enter workplace ,trigger overlay.
- Exit workplace
- Re-enter workplace ,PWD error!
Expected behavior
fixed.
Screenshots
Configuration
| key | value |
|---|---|
| version | 0.81.0 |
| branch | |
| commit_hash | |
| build_os | windows-x86_64 |
| build_target | x86_64-pc-windows-msvc |
| rust_version | rustc 1.68.2 (9eb3afe9e 2023-03-27) |
| rust_channel | 1.68.2-x86_64-pc-windows-msvc |
| cargo_version | cargo 1.68.2 (6feb7c9cf 2023-03-26) |
| build_time | 2023-06-19 22:25:44 +08:00 |
| build_rust_channel | release |
| features | dataframe, default, sqlite, trash, which, zip |
| installed_plugins | custom-value generate, custom-value generate2, custom-value update, from eml, from ics, from ini, from vcf, gstat, inc, nu-example-1, nu-example-2, nu-example-3, query, query json, query web, query xml |
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Windows failure using the configuration and numbered steps in the issue, focusing on the PWD environment-change hooks and overlay use/hide sequence. The issue is done when re-entering the workplace after exiting no longer produces the PWD variable error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100