overlay hide for core

Hide an active overlay.

Signature

> overlay hide {flags} (name)

Flags

  • --keep-custom, -k: Keep all newly added commands and aliases in the next activated overlay.
  • --keep-env, -e {list<string>}: List of environment variables to keep in the next activated overlay

Parameters

  • name: Overlay to hide.

Input/output types:

inputoutput
nothingnothing

Examples

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
    bar


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 { $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

Notes

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