nushell / nushell/nushell

Bare word interpolation is DoNotExpand

Open
#15,829 2 comments 2 reactions 1 assignee View on GitHub

@Bahex is already working on this.

Since Jun 5, 2025.

A:glob A:parser A:syntax category:bug
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 14h
Merged PRs (30d)
79

Description

Describe the bug

With #15735, bare word interpolation works correctly, however it seems like you can't use it to create globs:

ls ($nu.home-path)/test.txt
# => ╭───┬─────────────────────┬──────┬───────┬───────────────╮
# => │ # │        name         │ type │ size  │   modified    │
# => ├───┼─────────────────────┼──────┼───────┼───────────────┤
# => │ 0 │ /home/rose/test.txt │ file │ 154 B │ 10 months ago │
# => ╰───┴─────────────────────┴──────┴───────┴───────────────╯

ls ($nu.home-path)/*.txt
# => Error:   × No matches found for DoNotExpand("/home/rose/*.txt")
# =>   ╭─[entry #8:1:4]
# => 1 │ ls ($nu.home-path)/*.txt
# =>   ·    ──────────┬──────────
# =>   ·              ╰── Pattern, file or folder not found
# =>   ╰────
# =>  help: no matches found

(cc @Bahex)

How to reproduce

ls ($nu.home-path)/*

Expected behavior

I expected the argument to ls ($nu.home-path)/*.txt to be parsed a glob which would expand, in the same way that ls *.txt would.

Configuration
key value
version 0.104.2
major 0
minor 104
patch 2
branch makepkg
commit_hash 9a968c4bdddcf22bb83332d9b074baad88604418
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.85.1 (4eb161250 2025-03-15)
rust_channel 1.85.1-x86_64-unknown-linux-gnu
cargo_version cargo 1.85.1 (d73d2caf9 2024-12-31)
build_time 2025-05-27 08:00:55 +00:00
build_rust_channel release
allocator standard
features default, sqlite, trash
installed_plugins custom_values 0.1.0, example 0.104.2, explore_ir 0.6.0, formats 0.104.2, gstat 0.104.2, inc 0.104.2, polars 0.101.1, query 0.104.2, stress_internals 0.104.2

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.