nushell / nushell/nushell

Missing error message when using double quotes within double quotes

Open
#10,871 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A:error-unhelpful A:quoting-expansion category:inconsistent-behavior
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Describe the bug

When printing a string which contains variables, having a substring in doubl quotes should produce an error.

However, it doesn't always. See below

How to reproduce

Run

let name = "Harry Potter"
let exclaim = true

# this works ok but should not because "!" is double-quoted
print $"Hello, ($name)(if $exclaim { "!" })"

# this gives an error. Please note the space after the exclamation mark
print $"Hello, ($name)(if $exclaim { "! " })"
Expected behavior

The print statements above should produce an error in both cases

Screenshots

image

Configuration
key value
version 0.86.0
branch makepkg
commit_hash 5d8763ed1d14048ac9fc09eb21be36e6e622f0d7
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.73.0 (cc66ad468 2023-10-03) (Arch Linux rust 1:1.73.0-1)
cargo_version cargo 1.73.0
build_time 2023-10-18 08:45:09 +00:00
build_rust_channel release
allocator mimalloc
features dataframe, default, extra, sqlite, trash, which, zip
installed_plugins
Additional context

No response

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 running the provided interpolation examples against Nushell 0.86.0 and trace how the shell parses double quotes inside interpolated strings. Identify the relevant parser tests or entry point, then add coverage showing that both examples produce an error and confirm the existing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.