Skip to content

For internal commands, do not attempt to glob expand if the file path is wrapped in quotes. #11455

@crabdancing

Description

@crabdancing

Describe the bug

For files/dirs named with brackets, I've observed the following characteristics:

ls command without -D works fine on directories. (But only sometimes, not sure why)

ls command with -D erroneously fails on directories.

ls command with or without -D fails on files.

How to reproduce

  1. touch '[uwu]'

  2. ls -D '[uwu]'

  3. Observe:

Error:   × No matches found for [uwu]
   ╭─[entry #67:1:1]
 1 │ ls -D "[uwu]"
   ·       ───┬───
   ·          ╰── Pattern, file or folder not found
   ╰────
  help: no matches found

Expected behavior

I expect brackets to not change the behavior of ls.

Screenshots

No response

Configuration

key value
version 0.88.1
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.74.0 (79e9716c9 2023-11-13) (built from a source tarball)
cargo_version cargo 1.74.0
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
allocator mimalloc
features dataframe, default, extra, sqlite, trash, which, zip
installed_plugins from eml, from ics, from ini, from vcf, gstat, net, query, query json, query web, query xml, regex

Additional context

Note that this bug also affects glob, but strangely, doesn't affect mv or cp. Also, substituting single quotes with double quotes or backticks, seems to change nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions