nushell / nushell/nushell.github.io

Possibly erroneous code example in overlays.md

Open
#1,947 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
258
Forks
561
Avg merge
3h 20m
Merged PRs (30d)
15

Description

The following excerpt is from overlays.md:

Removing an Overlay

If you don't need the overlay definitions anymore, call overlay hide:

(spam)> overlay hide spam

(zero)> foo
Error: Can't run executable...

(zero)> overlay list
───┬──────
 0 │ zero
───┴──────

The overlays are also scoped.
Any added overlays are removed at the end of the scope:

(zero)> do { overlay use spam; foo }  # overlay is active only inside the block
foo

(zero)> overlay list
───┬──────
 0 │ zero
───┴──────

In the second code block, running the scoped code example leads to this:

❯ do { overlay use spam; foo }
Error: nu::shell::external_command

  × External command failed
   ╭─[entry #33:1:24]
 1 │ do { overlay use spam; foo }
   ·                        ─┬─
   ·                         ╰── Command `foo` not found
   ╰────
  help: A command with that name exists in module `spam`. Try importing it with `use`

I imagine this is due to the parsing stage not recognizing the foo command since it currently isn't in scope. I assume this is by design and it's the docs that fail to mention this. Perhaps we should modify the example to prevent confusion? Or perhaps I may have missed something. Please let me know. Thanks!

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

Start with the scoped overlay example in overlays.md and run it in Nushell to confirm the reported behavior. Check whether the example or its explanation is inaccurate, then update overlays.md so the documented command and expected result match the observed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.