Skip to content

mv '[].txt a' crashes, problems with bracket / glob pattern #4811

Closed

Description

@FilipAndersson245

Describe the bug

Nushell cannot handle Brackets correctly in some cases, example being when trying to mv a file containing them. This seem to be the same for multiple commands using globs, Would be nice to be able to disable globs if requested.

How to reproduce

  1. Have a file with name containing [ ]
  2. use mv to move/rename the file.

Expected behavior

I expect the file to be renamed, without an error.

Screenshots

image

Configuration

key value
version 0.59.1
branch main
short_commit 14dc662
commit_hash 14dc662
commit_date 2022-03-10 13:37:24 +00:00
build_os windows-x86_64
rust_version rustc 1.61.0-nightly (10913c000 2022-03-03)
rust_channel nightly-x86_64-pc-windows-msvc
cargo_version cargo 1.61.0-nightly (3d6970d50 2022-02-28)
pkg_version 0.59.1
build_time 2022-03-10 16:13:09 +01:00
build_rust_channel release
features dataframe, default, trash, which, zip
installed_plugins gstat

Additional context

No response

Activity

  1. changed the title [-]problems with bracket [/-] [+]`mv '[].txt a'` crashes, problems with bracket / glob pattern[/+] on Mar 10, 2022
  2. changed the title [-]`mv '[].txt a'` crashes, problems with bracket / glob pattern[/-] [+]mv '[].txt a' crashes, problems with bracket / glob pattern[/+] on Mar 10, 2022
  3. added
    status:needs-design
    on Mar 10, 2022
  4. fdncred commented on Mar 10, 2022

    @fdncred
    Contributor

    i personally want to keep globs and even enhance them so we could do ls [a-z]*.txt or ls [a..z]*.txt but I think we also need to be able to escape them. Maybe we need to add [ and ] as characters we can escape so we could do mv "blah\[something\]" something_else?

  5. fdncred commented on Mar 10, 2022

    @fdncred
    Contributor

    It looks like it's going to take more work than just adding more escape characters. i think we'll need to change how each command interacts with globs or have a helper function somewhere that every command can use when dealing with globs.

  6. added this to the v0.60.0 milestone on Mar 12, 2022
  7. fdncred commented on Mar 13, 2022

    @fdncred
    Contributor

    @FilipAndersson245 does #4818 fix this?

  8. FilipAndersson245 commented on Mar 13, 2022

    @FilipAndersson245
    ContributorAuthor

    Yes now it works

    key value
    version 0.59.1
    branch main
    short_commit c023d41
    commit_hash c023d41
    commit_date 2022-03-13 18:30:37 +00:00
    build_os windows-x86_64
    rust_version rustc 1.61.0-nightly (5f4e06771 2022-03-10)
    rust_channel nightly-x86_64-pc-windows-msvc
    cargo_version cargo 1.61.0-nightly (65c826642 2022-03-09)
    pkg_version 0.59.1
    build_time 2022-03-13 19:56:56 +01:00
    build_rust_channel release
    features dataframe, default, trash, which, zip
    installed_plugins gstat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-design

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions