edc / bass

Make Bash utilities usable in Fish shell
MIT License
2.2k stars 70 forks source link

Sourcing bash alias with question mark triggers `No matches for wildcard` error #87

Closed LucasPickering closed 3 years ago

LucasPickering commented 4 years ago

I'm trying to source a bash script that defines the alias k?. Specifically it has this line:

alias k?='khelp;'

Sourcing this works just fine in bash, but when I source it via bass, I get:

No matches for wildcard 'k?='khelp;''. See `help expand`.

I can easily get around this by just commenting out that line in the script, but as this is a shared script for my company, I can't actually get rid of it.

fish version: 3.1.2

Aside from this, bass has been great so far. Thank you!

edc commented 4 years ago

The issue is that fish does not allow ? in aliases:

$ alias k 'echo hello'
$ k
hello
$ alias k? 'echo hello'
fish: No matches for wildcard 'k?'. See `help expand`.
alias k? 'echo hello'
      ^

We could potentially replace the question mark in alias with something like _, but it might introduce conflict. Or we could also drop these problematic aliases. WDYT?

LucasPickering commented 4 years ago

@edc I would suggest we just drop those aliases, but also print out a warning about it if possible so it doesn't happen invisible. I think that's probably the easiest and safest solution.

edc commented 3 years ago

Thanks for reporting, and sorry about the late response. This is now fixed.