Bug report form
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.txt and 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
Bug report form
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
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