nushell / nushell/nushell

Throw an error in case of `cd <blah>; <keyword> <path-arg>`

Open
#4,359 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

For example, cd foo; use spam.nu * is destined to fail because the cwd is not updated yet when the spam.nu is parsed.

We can fix this for normal command by deferring the path expansion until the eval stage but for keyword commands this cannot work.

We should detect whether cd had been called in the current parse pass and throw an error if we try to call keyword commands with a relative path as an argument.

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 by tracing how cd is handled during a parse pass and how keyword-command arguments reach path expansion and evaluation. Reproduce cd foo; use spam.nu *, then verify that keyword commands with relative path arguments after cd produce an error while normal commands retain their existing behavior.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.