nushell / nushell/nushell

Auto overlay set PWD Variable error

Open
#9,541 1 comment 0 reactions 0 assignees View on GitHub

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
  1. 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 = ''"
        }
    ])
  1. Create mod.nu file.
  2. Enter workplace ,trigger overlay.
  3. Exit workplace
  4. Re-enter workplace ,PWD error!
Expected behavior

fixed.

Screenshots

image
image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.