withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.05k stars 63 forks source link

Aliases not working #1074

Closed clo4 closed 2 years ago

clo4 commented 2 years ago

Aliases aren't working for me in any shell.

Diagnostic Duplicate entries in path because of testing stuff 😛 # Fig Diagnostics ## Fig details: - Fig version: Version 1.0.56 (B401) [U.S.] - Bundle path: /Applications/Fig.app - Autocomplete: true - Settings.json: true - Accessibility: true - Number of specs: 0 - Symlinked dotfiles: true - Only insert on tab: false - Keybindings path: - Installation Script: false - PseudoTerminal Path: /opt/homebrew/opt/node@14/bin:/Users/robert/.local/bin:/Users/robert/.fig/bin:/opt/homebrew/opt/python@3.10/bin:/opt/homebrew/opt/libpq/bin:/opt/homebrew/bin:/Users/robert/.flutter/bin:/Users/robert/.deno/bin:/Users/robert/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin - SecureKeyboardInput: false - SecureKeyboardProcess: ## Hardware Info: - Model Name: MacBook Air - Model Identifier: MacBookAir10,1 - Chip: Apple M1 - Cores: 8 (4 performance and 4 efficiency) - Memory: 16 GB ## OS Info: - macOS 12.2.1 (21D62) ## Environment: - User Shell: /opt/homebrew/bin/fish - Current Directory: /Users/robert/.config/fish/conf.d - CLI Installed: true - Executable Location: /Users/robert/.local/bin/fig - Current Window ID: 7234/% (com.googlecode.iterm2) - Active Process: fish (26096) - /dev/ttys015 - Installed via Brew: true - Environment Variables: - FIG_TERM=1 - TERM_SESSION_ID=w1t2p0:9CF80E17-806B-42A7-B6B2-C3AC891EC78C - FIG_CHECKED_PROMPTS=1 - PATH=/opt/homebrew/opt/python@3.10/bin:/opt/homebrew/opt/libpq/bin:/opt/homebrew/bin:/Users/robert/.flutter/bin:/Users/robert/.deno/bin:/opt/homebrew/opt/node@14/bin:/Users/robert/.cargo/bin:/opt/homebrew/opt/node@14/bin:/Users/robert/.local/bin:/Users/robert/.fig/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin - FIG_INTEGRATION_VERSION=8 - TERM=xterm-256color - FIG_TERM_VERSION=4.2.0 ## Integrations: - SSH: false - TMUX: false - iTerm: installed! - Hyper: installed! - Visual Studio Code: installed! - Docker: false
mschrage commented 2 years ago

I can reproduce this using zsh and powerlevel10k.

oliveratgithub commented 2 years ago

+1

mschrage commented 2 years ago

@oliveratgithub what shell are you using? Can you share your bashrc/zshrc?

oliveratgithub commented 2 years ago

Ik@mschrage Sure!

My .bashrc:


#### FIG ENV VARIABLES ####
# Please make sure this block is at the start of this file.
[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh
#### END FIG ENV VARIABLES ####

#### FIG ENV VARIABLES ####
# Please make sure this block is at the end of this file.
[ -s ~/.fig/fig.sh ] && source ~/.fig/fig.sh
#### END FIG ENV VARIABLES ####

source .bash_profile

…and my .zhsrc:


#### FIG ENV VARIABLES ####
# Please make sure this block is at the start of this file.
[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh
#### END FIG ENV VARIABLES ####
# Load ~/.bash_profile into ~/.zshrc
if [ -f ~/.bash_profile ]; then
    . ~/.bash_profile;
fi

#### FIG ENV VARIABLES ####
# Please make sure this block is at the end of this file.
[ -s ~/.fig/fig.sh ] && source ~/.fig/fig.sh
#### END FIG ENV VARIABLES ####

source .bash_profile

...and my .bash_profile


#### FIG ENV VARIABLES ####
# Please make sure this block is at the start of this file.
[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh
#### END FIG ENV VARIABLES ####
# Source:
#    https://gist.github.com/kkirsche/5710272#gistcomment-1541612
#    https://tommcfarlin.com/setting-php-and-composer-in-mamp/
#
# MAMP
alias mamp='/Applications/MAMP/bin/start.sh'
alias mamp_stop='/Applications/MAMP/bin/stop.sh'

# for MAMP PHP 5.6:
#php5=`ls /Applications/MAMP/bin/php/ | sort -n | tail -3 | head -1`
#export PHPMAMP='/Applications/MAMP/bin/php/php5.6.31/bin/php'
#export PATH="$PHPMAMP:$PATH"
alias php5='/Applications/MAMP/bin/php/php5.6.40/bin/php'

# for MAMP PHP 7:
#php7=`ls /Applications/MAMP/bin/php/ | sort -n | tail -2 | head -1`
alias php='/Applications/MAMP/bin/php/php7.4.21/bin/php'

# for MAMP PHP 8:
#alias php8='/Applications/MAMP/bin/php/php8.0.8/bin/php'

# Composer (not required because composer is in /user/local/bin/)
#alias composer='php /Applications/MAMP/bin/php/${PHP5}/bin/composer.phar'
#export PATH=/Applications/MAMP/bin/php/${PHP5}/bin:$PATH
export PHPMAMP=/Applications/MAMP/bin/php/php7.4.21/bin
export PATH="${PHPMAMP}:$PATH"

# Apache
alias apachectl='/Applications/MAMP/Library/bin/apachectl'
alias apache='/Applications/MAMP/Library/bin/apachectl'
export ENVIRONMENT='development'

# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH

# ================ Projects ===================
# FUSE mount
alias keepass="sshfs -o allow_other,defer_permissions user@domain.com:/secret/keepass /Users/Shared/KeePass\ DB"

# SSH
alias server="ssh user@domain.ch"

#### FIG ENV VARIABLES ####
# Please make sure this block is at the end of this file.
[ -s ~/.fig/fig.sh ] && source ~/.fig/fig.sh
#### END FIG ENV VARIABLES ####
brendanfalk commented 2 years ago

@oliveratgithub This issue should be fixed in our latest version: v1.0.56 build 414. Could you please run fig update?

Going to close this issue for now. Please comment if still not working and we will re-open

oliveratgithub commented 2 years ago

This issue should be fixed in our latest version: v1.0.56 build 414. Could you please run fig update?

@brendanfalk did as suggested, but unfortunately it's still not working for me. None of my aliases are suggested by fig (only default shell autocomplete works).

Here's my fig diagnostics:

# Fig Diagnostics
## Fig details:
  - Fig version: Version 1.0.56 (B416) [Swiss German]
  - Bundle path: /Users/xx/Applications/Fig.app
  - Autocomplete: true
  - Settings.json: true
  - Accessibility: true
  - Number of specs: 211
  - Symlinked dotfiles: false
  - Only insert on tab: false
  - Keybindings path: 
  - Installation Script: true
  - PseudoTerminal Path: /Applications/MAMP/bin/php/php7.4.21/bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xx/.local/bin:/Users/xx/.fig/bin:/Users/xx/.local/bin:/Users/xx/.local/bin
  - SecureKeyboardInput: false
  - SecureKeyboardProcess: <none>
## Hardware Info:
  - Model Name: MacBook Air
  - Model Identifier: MacBookAir8,1
  - Chip: 
  - Cores: 2
  - Memory: 8 GB
## OS Info:
  - macOS 12.3.0 (21E230)
## Environment:
  - User Shell: /bin/zsh
  - Current Directory: /Users/xx
  - CLI Installed: true
  - Executable Location: /usr/local/bin/fig
  - Current Window ID: 1691/% (com.apple.Terminal)
  - Active Process: zsh (16018) - /dev/ttys004
  - Environment Variables:
    - TERM=xterm-256color
    - TERM_SESSION_ID=5758DAFD-DE91-4279-9EDA-1B1167357D17
    - PATH=/Applications/MAMP/bin/php/php7.4.21/bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xx/.local/bin:/Users/xx/.fig/bin:/Users/xx/.local/bin:/Users/xx/.local/bin
    - FIG_INTEGRATION_VERSION=8
    - FIG_TERM=1
    - FIG_TERM_VERSION=4.3.0
## Integrations:
  - SSH: false
  - TMUX: false
  - iTerm: application is not present.
  - Hyper: application is not present.
  - Visual Studio Code: application is not present.
  - Docker: false
mschrage commented 2 years ago

I don't think we have completion specs for any of your aliases. Can you please elaborate on the behavior you are expecting @oliveratgithub?

oliveratgithub commented 2 years ago

I don't think we have completion specs for any of your aliases.

When I have fig launched & type the first characters of any of my custom aliases in Terminal, I would expect fig to autocomplete/propose the matching aliases.

Eg: % mam -> fig suggest command completion: mamp mamp_stop

But raising the question here, if fig even is built to propose/autocomplete the command part in the terminal? Is that a feature? Like typing "gi" it would already propose to complete "git"?

mschrage commented 2 years ago

I see! This functionality makes total sense. Would you mind creating a separate issue for it.

This issue was referring to a different bug where aliases were not being loaded at all. (Currently we load them so that if you have aliased git to g, we can still present suggestions for git subcommands.)

oliveratgithub commented 2 years ago

@mschrage Okay got it! Yes will raise this as a separate feature then. Sorry for the confusion