fish-abbreviation-tips icon indicating copy to clipboard operation
fish-abbreviation-tips copied to clipboard

Does not work for aliases defined inside fish scripts

Open vorburger opened this issue 2 years ago • 0 comments

Describe the bug

#29 for #27 made abbr -a y ls -l && ls -l show :bulb: y => ls -l - thank you @gazorby!

It also DOES work for an alias (which is just a Fish function --wraps), as long as I type that alias on the prompt, for example this is great:

$ alias c="bat "
$ functions c
# Defined via `source`
function c --wraps='bat ' --description 'alias c=bat '
  bat  $argv

end

$ bat ~/.gitconfig
(...)
💡 c => bat

What I'm struggling with is to get this to work for aliases defined inside a Fish script....

To Reproduce

Steps to reproduce the behavior:

$ functions --erase c
$ echo 'alias c="bat "' >repro.fish
$ source repro.fish
$ functions c
# Defined via `source`
function c --wraps='bat ' --description 'alias c=bat '
  bat  $argv

end

$ bat repro.fish
(...)
# Does *NOT* print 💡 c => bat

Expected behavior

💡 c => bat

System (please complete the following information):

  • fish, version 3.6.0
  • Fedora 37 Workstation

vorburger avatar Feb 17 '23 14:02 vorburger