Skip to content

nushell 0.94.1 breaks Windows path handling #13016

Closed

Description

@CarterLi

Describe the bug

Error:   × Invalid literal
     ╭─[C:\Users\zhang\AppData\Roaming\nushell\config.nu:792:17]
 791 │ #use ~/.starship.nu
 792 │ alias curl = c:\msys64\clangarm64\bin\curl.exe
     ·                 ───────────────┬──────────────
     ·                                ╰── unrecognized escape after '\' in string
 793 │ alias vim = nvim
     ╰────

How to reproduce

Windows style paths in config file result in error unrecognized escape after '\' in string

Expected behavior

Don't error

Screenshots

N/A

Configuration

N/A

Additional context

Regression in 0.94.1. It worked in 0.94.0

Activity

  1. added
    status:needs-triage
    on May 31, 2024
  2. yizhepku commented on May 31, 2024

    @yizhepku
    Contributor

    @devyn Probably a side-effect of #13001.

  3. Deebster commented on May 31, 2024

    @Deebster

    You can replace each backslash with a double backslash, but it's very tedious to do this outside of scripts.

    I've downgraded until it's fixed with cargo install --version 0.94.0 nu (edit: hmm, I'm now seeing the issue on 0.94.0)

  4. CarterLi commented on May 31, 2024

    @CarterLi
    Author

    starship generates nu scripts with Windows style paths.

    BTW starship works weird after upgrading nu to 0.94.0+

  5. chtenb commented on May 31, 2024

    @chtenb

    Huh, I downgraded to 0.94.0 again, but the issue persists, as in, my config scripts that worked earlier on 0.94.0 no longer work after downgrading from 0.94.1!

  6. kubouch commented on May 31, 2024

    @kubouch
    Contributor

    On my Windows end, the issue appears at 0.94.1. The version 0.94.0 works fine.

  7. added
    category:bug
    platform:windows
    and removed
    status:needs-triage
    on Jun 1, 2024
  8. added a commit that references this issue on Jun 3, 2024
    b50903c
  9. rogtino commented on Jun 3, 2024

    @rogtino

    Hello team,would you mind posting a bug fix release?

  10. kubouch commented on Jun 3, 2024

    @kubouch
    Contributor

    Yes, it's coming within a day.

  11. added this to the v0.95.0 milestone on Jun 4, 2024
  12. xd003 commented on Dec 15, 2024

    @xd003

    I am still facing this issue on latest nushell version 0.100.0

    ❯ 7z x "C:\Users\Admin\Documents\archive.zip"
    Error:   × Invalid literal
       ╭─[entry #3:1:9]
     1 │ 7z x "C:\Users\Admin\Documents\archive.zip"
       ·         ─────────────────┬─────────────────
       ·                          ╰── unrecognized escape after '\' in string
       ╰────
    
    ❯ nu --version
    0.100.0
    
  13. kubouch commented on Dec 15, 2024

    @kubouch
    Contributor

    " denotes escaped strings, like in JSON. It's better to use non-escaped strings (') for Windows paths (or use forward slashes). It should also work without quotes - that's what the original issue is about

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

    category:bugplatform:windows

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions