JanDeDobbeleer / aliae

Cross shell and platform alias management
https://aliae.dev
MIT License
73 stars 3 forks source link

Nu: Unescaped Paths #124

Open RuiNtD opened 3 weeks ago

RuiNtD commented 3 weeks ago

Code of Conduct

What happened?

Nu gives an error trying to add an alias

Error:   × Invalid literal
   ╭─[C:\Users\ethan\.aliae.nu:3:17]
 2 │
 3 │ alias curl = C:\Users\ethan\scoop\shims\curl.exe
   ·                 ────────────────┬───────────────
   ·                                 ╰── unrecognized escape after '\' in string
 4 │
   ╰────

What OS are you seeing the problem on?

Windows

Which shell are you using?

nu

JanDeDobbeleer commented 3 weeks ago

You need to use forward slashes, works everywhere. Difficult to know if I should escape or not. That alias wouldn't work directly either.

RuiNtD commented 3 weeks ago
alias:
  - name: curl
    if: eq .OS "windows"
    value: '{{ .Home }}\scoop\shims\curl.exe'

I use {{ .Home }} all over my config, so just changing everything to forward slashes isn't that easy.

JanDeDobbeleer commented 3 weeks ago

@RuiNtD interesting. Let me see how that could be solved.

RuiNtD commented 2 weeks ago

This was fixed in Nushell 0.94.2 via https://github.com/nushell/nushell/pull/13027