Aliases not useable from within functions
Sanity checks
- [X] I have searched github.com/withfig/fig/issues and there are no duplicates of my issue
- [X] I have run
fig doctorin the affected terminal session - [X] I have run
fig restartand tested again (tell us if that fixed it)
Issue Details
Description:
My expectations are that I should be able to call/use an alias from within a function. Just as I can using normal bash/zsh.
What happens is that it does not know the aliases exists when called from within a function.
Steps:
- Create the following aliases
- Name:
figtestCommand:echo "testing..." - Name:
figtest2Command:figtest - Name:
figtest3Command:figtestfn "testing alias to function"
- Name:
- Create the following functions
- Name:
figtestfnCommand:echo $1 - Name:
figtestfn2Command:figtestfn "testing function to function" - Name:
figtestfn3Command:echo "testing function to alias" && figtest
- Name:
- Run any of the aliases and they run perfectly as expected
- Run the first 2 functions and they also run as expected
- Run the last function and it fails saying that the
figtestcommand was not found
Video showing steps as well
https://user-images.githubusercontent.com/7863352/193305392-9bbadf09-cc52-424c-81c7-a329cfe73e83.mp4
Environment
fig-details:
- desktop-version: Version 1.0.61 (B528) [U.S.]
hardware-info:
- model: MacBook Pro
- model-id: MacBookPro16,1
- chip-id:
- cores: 6
- mem: 16 GB
os-info:
- macOS 12.6.0 (21G115)
environment:
- shell: /bin/zsh
- terminal: terminal
- cwd: /Users/jkillingsworth
- exe-path: /usr/local/bin/fig
- install-method: unknown
- env-vars:
- FIG_INTEGRATION_VERSION: 8
- FIG_TERM: 1
- FIG_TERM_VERSION: 5.2.0
- PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/jkillingsworth/.fig/bin:/Users/jkillingsworth/.local/bin:
- SHELL: /bin/zsh
- TERM: xterm-256color
- TERM_SESSION_ID: 22655D1F-A847-4D80-ABA0-64553812092E
- FIG_PID: 14703
- integrations:
- SSH: false
- TMUX: false
- iTerm: application is not present.
- Hyper: application is not present.
- Visual Studio Code: installed!
- Docker: false
I believe this is supported already, although perhaps we should change the default ordering.
You can manually control the order that blocks are sourced, by clicking "View by" > "Source Order".

Let me know if this doesn't resolve the issue for you.
I had tried that but did not show it. I put a video together to show it in the suggested sort order and even moved the alias around in the order and still was not able to get it to work. here is a clip of using the source order and moving the alias around
https://user-images.githubusercontent.com/7863352/193412072-2cd09699-33a1-4a9b-9440-16f47c4298a6.mp4
Both of the mp4 files you've sent seem to be corrupted. (Or at least, I cannot seem to play them). How are you taking the recordings?
I use KAP to do the recordings. My team uses it all the time to get gifs and mp4s to post to slack, jira, and github. Granted we all are using Macs so that may make a difference.
I have downloaded the mp4s and posted them to my youtube. Here are links to both for you.
https://youtu.be/BMMZaMXSJ0c - First video using default sorting in the app https://youtu.be/3NHxMbGTWII - Second video using source order sorting in the app
Hope both of these work for you.