Skip to content

Auto overlay set PWD Variable error #9541

@aa1ss2

Description

@aa1ss2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:hooksHooks are used to react to changes during interactive executionstatus:needs-triageAn issue that hasn't had any proper look

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions