History expansion (!!) triggers inside backtick-quoted strings, corrupting file paths
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Reproduce the reported command after creating a filename containing !! and adding a history entry. Trace how history expansion and backtick quoting are handled, then verify that the quoted path remains literal and add regression coverage for the example behavior.
Written by the indexing model from the issue text.
Description
Bug report form
- I have done a basic search of the issue tracker to find any existing issues that are similar.
- I have checked that my version is at least the latest stable release available via my installation method.
Describe the bug
When a filename contains !!, Nushell performs history expansion on it even when the name is wrapped in backticks. Since backticks are a quoting form, no history expansion should occur inside them. The result is that the token is silently rewritten to a different path before the command executes, making the real file impossible to reference by name.
Bug outcome:
On Enter, the command line is rewritten to ls test & test ls test.txt — !! has been expanded to the first token of the previous command (ls). The backticks did not prevent the expansion. The command then fails or targets the wrong path, and the actual file on disk cannot be addressed via its real name.
How to reproduce
- Create a file whose name contains !!, e.g. test & test !! test.txt.
- Run any command, e.g. ls, so that history has at least one entry.
- Type: ls
test & test !! test.txtand press Enter.
Expected behavior
The backtick-quoted string is passed through literally. ls (or rm, open, etc.) operates on the file test & test !! test.txt. This matches how Bash and Zsh handle history expansion inside single quotes.
Configuration
version │ 0.112.2
major │ 0
minor │ 112
patch │ 2
branch │
commit_hash │ d80ee8c19e07a8058e50a30a4205d3e97068f585
build_os │ windows-x86_64
build_target │ x86_64-pc-windows-msvc
rust_version │ rustc 1.92.0 (ded5c06cf 2025-12-08)
rust_channel │ 1.92.0-x86_64-pc-windows-msvc
cargo_version │ cargo 1.92.0 (344c4567c 2025-10-21)
build_time │ 2026-04-15 21:31:35 +00:00
build_rust_channel │ release
allocator │ standard
features │ default, mcp, network, plugin, rustls-tls, sqlite, trash-support
installed_plugins │
experimental_options │ example=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=false, native-clip=false, cell-path-types=false
- Dominant language
- Rust
- Stars
- 818
- Forks
- 249
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nushell/reedline
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
All issues in nushell/reedline
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100