withfig / fig

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

Fig does not work with powerlevel-9k #853

Closed luokuning closed 2 years ago

luokuning commented 2 years ago

Sanity checks

Issue Details

Description:

Fig does not work with oh-my-zsh, but works well with bash, here is the screenshot:

Screen Recording 2022-01-29 at 19 54 48

I don't know what's going on. Is there something wrong with my configuration?

Environment

Fig Version: Version 1.0.55 (B365) [U.S.]
UserShell: /bin/zsh
Bundle path: /Applications/Fig.app
Autocomplete: true
Settings.json: true
CLI installed: true
CLI tool path: /usr/local/bin/fig
Accessibility: true
Number of specs: 0
SSH Integration: false
Tmux Integration: false
Keybindings path:
iTerm Integration: installed!
Hyper Integration: application is not present.
VSCode Integration: installed!
Docker Integration: false
Symlinked dotfiles: false
Only insert on tab: false
Installed via Brew: true
Installation Script: true
PseudoTerminal Path: /usr/local/sbin:/Users/cuishimin/.deno/bin:/usr/local/opt/openjdk/bin:/Users/cuishimin/go/bin:/Users/cuishimin/bin:/usr/local/bin:/Users/cuishimin/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Users/cuishimin/.fig/bin
SecureKeyboardInput: false
SecureKeyboardProcess: <none>
Current active process: zsh (28761) - /dev/ttys001
Current working directory: /Users/cuishimin
Current window identifier: 447/% (com.googlecode.iterm2)
Path: /usr/local/sbin:/Users/cuishimin/.deno/bin:/usr/local/opt/openjdk/bin:/Users/cuishimin/go/bin:/Users/cuishimin/bin:/usr/local/bin:/Users/cuishimin/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Users/cuishimin/.fig/bin
Fig environment variables:
  - TERM_SESSION_ID=w0t0p0:AEEFA329-59D7-4BFD-B583-B77388B89EF3
  - FIG_INTEGRATION_VERSION=5
  - FIG_TERM=1
  - FIG_TERM_VERSION=3
  - FIG_ENV_VAR=1
  - FIG_CHECKED_PROMPTS=1
MacOS Version: 12.2 21D49
Hardware:
  - Model Name: iMac
  - Model Identifier: iMac19,1
  - Chip:
  - Cores: 8
  - Memory: 52 GB
mschrage commented 2 years ago

Hmm very strange. Thanks for reporting @luokuning! Would you mind sharing your zshrc?

Also could you run FIG_LOG_LEVEL=DEBUG, then in a separate terminal run fig debug logs and take a screen recording of both terminal sessions.

luokuning commented 2 years ago

@mschrage Sorry for the late response, here is my zshrccontent:

#### 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 ####

# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="robbyrussell"
#ZSH_THEME="lk"
ZSH_THEME="powerlevel9k/powerlevel9k"

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
function precmd () {
  window_title="\033]0;${PWD##*/}\007"
  echo -ne "$window_title"
}

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git colored-man-pages colorize github jira vagrant virtualenv npm yarn macos zsh-syntax-highlighting zsh-autosuggestions docker docker-machine docker-compose kubectl fig)

# User configuration

export PATH=$HOME/go/bin:$HOME/bin:/usr/local/bin:$PATH
# export MANPATH="/usr/local/man:$MANPATH"

source $ZSH/oh-my-zsh.sh

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

alias startnginx="sudo /usr/local/nginx/sbin/nginx"
alias reloadnginx="sudo /usr/local/nginx/sbin/nginx -s reload"
alias loginms="ssh luokun@173.192.175.13"
alias logindo="ssh root@104.131.157.37"
alias loginls="ssh root@223.223.219.168"
alias edithosts="subl /etc/hosts"
alias getpubip="curl ident.me"
alias gettrace="curl cip.cc"
alias ll="exa -al"

eval $(thefuck --alias)

test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"

autoload -Uz compinit
compinit
# Completion for kitty
# kitty + complete setup zsh | source /dev/stdin

# alias icat="kitty +kitten icat"
# alias diff="kitty +kitten diff"
# alias xssh="kitty +kitten ssh"

zsh_incognito_icon() {
    echo '\ufaf8'
}
POWERLEVEL9K_CUSTOM_INCOGNITO_ICON="zsh_incognito_icon"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_incognito_icon dir vcs)
export PATH="/usr/local/opt/openjdk/bin:$PATH"

export DENO_INSTALL="/Users/cuishimin/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"

export GITHUB_TOKEN=***
export NPM_TOKEN=***
bindkey \^U backward-kill-line
export PATH="/usr/local/sbin:$PATH"

#### 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 ####

and here is the fig debug logs output when I enter git status in a new terminal window:

﫸  ~  fig debug logs                                   ✔  10007  07:35:04
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 34 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 34 chars to child shell: git status
figterm (70864): [figterm.c:167] Current fg:: indexed 2
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: |
index: 0
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........g.........                                       .....................

cursor pos: 1 10
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"","cursor":"0","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 30 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 30 chars to child shell:gi
figterm (70864): [figterm.c:167] Current fg:: indexed 1
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:167] Current fg:: indexed 1
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: i|
index: 1
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........gi........                                       .....................

cursor pos: 1 11
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"i","cursor":"1","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 33 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 33 chars to child shellgit
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:167] Current fg:: indexed 2
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:167] Current fg:: indexed 2
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:167] Current fg:: indexed 2
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: it|
index: 2
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git.......                                       .....................

cursor pos: 1 12
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it","cursor":"2","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 6 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 6 chars to child shell:
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: it |
index: 3
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git ......                                       .....................

cursor pos: 1 13
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it ","cursor":"3","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 6 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 6 chars to child shell: s
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: it s|
index: 4
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git s.....                                       .....................

cursor pos: 1 14
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it s","cursor":"4","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 34 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 34 chars to child shell: a
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: it sa|
index: 5
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git sa                                           .....................

cursor pos: 1 15
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it sa","cursor":"5","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 1 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 1 chars to child shell: t
figterm (70864): [main.c:169] guess: it sat|
index: 6
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git sat                                          .....................

cursor pos: 1 16
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it sat","cursor":"6","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 3 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 3 chars to child shell:
figterm (70864): [main.c:169] guess: it sa|
index: 5
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git sa                                           .....................

cursor pos: 1 15
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it sa","cursor":"5","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 26 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 26 chars to child shell:tatus
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: it s|
index: 4
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git s.....                                       .....................

cursor pos: 1 14
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it s","cursor":"4","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 6 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 6 chars to child shell: t
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: it st|
index: 5
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git st....                                       .....................

cursor pos: 1 15
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it st","cursor":"5","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 6 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 6 chars to child shell: a
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: it sta|
index: 6
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git sta...                                       .....................

cursor pos: 1 16
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it sta","cursor":"6","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
figterm (70864): [main.c:242] Read 1 chars on stdin
figterm (70864): [main.c:250] read 6 chars on ptyp_fd (2)
figterm (70864): [figterm.c:387] Writing 6 chars to child shell: t
figterm (70864): [figterm.c:164] Current fg:: rgb 240, 240, 240
figterm (70864): [figterm.c:167] Suggestion fg:: indexed 8
figterm (70864): [main.c:169] guess: it stat|
index: 7
figterm (70864): [figterm.c:381]
text:
........FIG_LOG_LEVEL=DEBUG                              .....................
........git stat..                                       .....................

cursor pos: 1 17
figterm (70864): [util.c:291] done sending {"hook":{"editBuffer":{"text":"it stat","cursor":"7","context": {"pid":"70872","ttys":"/dev/ttys001","processName":"zsh","sessionId":"w0t0p0:6985FAE4-605C-471F-910A-DB5557EDDDF7","integrationVersion": "5","hostname":"cuishimin@luokundeiMac-3.local"}}}}
mschrage commented 2 years ago

Hey @luokuning! It looks like all of the editbuffer events are missing the first character.

Rather than seeing git status, the autocomplete engine is receiving it status. Since there is no completions spec for "it", no suggestions are displayed.

This likely is the result of an incompatibility with your prompt or another shell integration.

Can you try commenting out the iTerm integration and see if the issues persists? Also try switching your zsh theme back to robbyrussell

luokuning commented 2 years ago

Hi @mschrage, Thanks for commenting out the sensitive message in my zshrc 😄. After replacing my zsh theme with robbyrussell, everything just works well! So I guess maybe powerlevel9k or powerlevel10k(I also tried this one) has some compatibility issues with Fig in some way.

Any way, my problem is solved for now, so I'll just close this issue. Thanks again!