overlay hide for core

Hide an active overlay.


> overlay hide (name) --keep-custom --keep-env


  • name: Overlay to hide
  • --keep-custom (-k): Keep all newly added commands and aliases in the next activated overlay
  • --keep-env {list<string>}: List of environment variables to keep in the next activated overlay


This command is a parser keyword. For details, check: https://www.nushell.sh/book/thinking_in_nu.html


Keep a custom command after hiding the overlay

> module spam { export def foo [] { "foo" } }
    overlay use spam
    def bar [] { "bar" }
    overlay hide spam --keep-custom

Hide an overlay created from a file

> 'export alias f = "foo"' | save spam.nu
    overlay use spam.nu
    overlay hide spam

Hide the last activated overlay

> module spam { export-env { let-env FOO = "foo" } }
    overlay use spam
    overlay hide

Keep the current working directory when removing an overlay

> overlay new spam
    cd some-dir
    overlay hide --keep-env [ PWD ] spam