fig icon indicating copy to clipboard operation
fig copied to clipboard

Auto-suggestions don't react well when I use git aliases

Open ftonato opened this issue 2 years ago • 2 comments

Hi, thanks for your cool project, I'm using it for a while and I'm very satisfied.

Description:

Normally I'm using fig in the terminal (with zsh) but sometimes I try to use it also in the VSCode integration terminal and the problem I'm going to describe happens in both scenarios (but not always).

Context: I have some git aliases, for example: git ll (log), git co (checkout) and git cb (switch -c).

Let's assume the following scenario:

  1. I am working on branch A
  2. I would like to switch to the B branch 2.1) For that I'll type git co, and press tab to see the name of my branches (they won't show up) 2.2) Fig will start suggesting something, but I will ignore it and type the branch name

As soon as I hit enter it will complete with the suggestion of fig instead of "run my command".

02

Basically this "problem" happens whenever I type my aliases, because fig doesn't know what aliases do and what to suggest, so it ends up suggesting something standard (I guess).

Details:

OS Fig Shell
macOS 12.2.1 (21D62) 1.0.58 /usr/local/Cellar/zsh/5.8.1/bin/zsh
fig diagnostic

Fig Diagnostics

Fig details:

  • Fig version: Version 1.0.58 (B472) [Portuguese]
  • Bundle path: /Applications/Fig.app
  • Autocomplete: true
  • Settings.json: true
  • Accessibility: true
  • Number of specs: 0
  • Symlinked dotfiles: false
  • Only insert on tab: false
  • Keybindings path:
  • Installation Script: true
  • PseudoTerminal Path:
  • SecureKeyboardInput: false
  • SecureKeyboardProcess:

Hardware Info:

  • Model Name: MacBook Pro
  • Model Identifier: MacBookPro15,1
  • Chip:
  • Cores: 6
  • Memory: 16 GB

OS Info:

  • macOS 12.2.1 (21D62)

Environment:

  • User Shell: /bin/zsh
  • Current Directory: /Users/ftonato/work/platform/vue/packages/my-app
  • CLI Installed: true
  • Executable Location: /usr/local/bin/fig
  • Current Window ID: 46105/% (com.microsoft.VSCode)
  • Active Process: zsh (37180) - /dev/ttys001
  • Installed via Brew: true
  • Environment Variables:
    • PATH=/Users/ftonato/.nvm/versions/node/v14.19.0/bin:/Users/ftonato/Library/pnpm:/Users/ftonato/.nvm/versions/node/v12.22.12/bin:/usr/local/opt/make/libexec/gnubin:/Users/ftonato/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/ftonato/Library/pnpm:/Users/ftonato/.nvm/versions/node/v12.22.12/bin:/usr/local/opt/make/libexec/gnubin:/Users/ftonato/.npm-global/bin:/Users/ftonato/.fig/bin:/Users/ftonato/.local/bin.:/Users/ftonato/.local/bin.:/Users/ftonato/.local/bin
    • FIG_WORKFLOWS_KEYBIND=^f
    • FIG_PID=37180
    • TERM=xterm-256color
    • TERM_SESSION_ID=65381CBF-8032-41F4-A464-B411DD763B0F
    • FIG_INTEGRATION_VERSION=8
    • FIG_TERM=1
    • FIG_TERM_VERSION=4.4.1

Integrations:

  • SSH: false
  • TMUX: false
  • iTerm: application is not present.
  • Hyper: application is not present.
  • Visual Studio Code: installed!
  • Docker: false

ftonato avatar Jul 22 '22 22:07 ftonato

Hmm, that's definitely unexpected... can you share your alias definitions? You can run this command to get them all:

git config --global --get-regexp 'alias.*'

It should be giving you relevant suggestions: Screen Shot 2022-07-27 at 5 03 24 pm

clo4 avatar Jul 27 '22 07:07 clo4

@SeparateRecords the list is below:

alias.aa add --all
alias.bd branch -d
alias.bb branch
alias.ca commit --amend
alias.cb switch -c
alias.co checkout
alias.di diff
alias.ls log --pretty=format:%C(yellow)%h%Cred%d\ %Creset%s%Cblue\ [%cn] --oneline
alias.st status --short --branch
alias.ll !ll() { msg=-n${1- 5}; git ls $msg; }; ll
alias.pff !pff() { git pull --all && git fetch -p; }; pff
alias.cpl !cpl() { git log -1 --pretty=%B | awk '{gsub(/^([0-9])+ /, "- "); print}' | pbcopy; }; cpl
alias.fixup !f(){ git reset --soft HEAD~${1} && git commit --amend -C HEAD; }; f
alias.freset !r(){ git reset $(git commit-tree HEAD^{tree} -m 'Initial commit'); }; r

ftonato avatar Jul 28 '22 14:07 ftonato

cc @sullivan-sean

parssak avatar Sep 14 '22 18:09 parssak