Skip to content

Glob expansion should not happen for external commands when quoted #4631

@lukexor

Description

@lukexor

Describe the bug

Currently it's impossible to pass a glob-like string to an external command, as nushell expands globs even when quoted.

Some commands like the UI testing framework cypress allow passing in filter globs, I believe jest offers similar arguments.

How to reproduce

> npx run cypress --spec "cypress/integration/**/*"

(or any external command that takes a glob string)

Expected behavior

Expected:

npx run cypress "--spec" "cypress/integration/**/*"

Actual:

npx run cypress "--spec" "<file1>" "<file2>" "<file3>" "<etc>"

Screenshots

No response

Configuration

| key                | value                                    |
| ------------------ | ---------------------------------------- |
| version            | 0.59.0                                   |
| branch             | main                                     |
| short_commit       | 3c62d27c                                 |
| commit_hash        | 3c62d27c280dd7a7ba276760c239bfaa1b5080cd |
| commit_date        | 2022-02-24 19:02:28 +00:00               |
| build_os           | macos-x86_64                             |
| rust_version       | rustc 1.58.1 (db9d1b20b 2022-01-20)      |
| rust_channel       | stable-x86_64-apple-darwin               |
| cargo_version      | cargo 1.58.0 (f01b232bc 2022-01-19)      |
| pkg_version        | 0.59.0                                   |
| build_time         | 2022-02-24 12:20:29 -08:00               |
| build_rust_channel | release                                  |
| features           | default, which                           |
| installed_plugins  |                                          |

Additional context

Single quotes, double quotes, or unquoted all result in the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:globBehavior around file-system globbing with regular commands or `glob`. See also A:quoting/expansioncategory:bugSomething isn't workingdeprecated:priority(deprecated: used infrequently) these issues are importantstatus:needs-designthis feature requires design

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions