Aloxaf / fzf-tab

Replace zsh's default completion selection menu with fzf!
MIT License
3.28k stars 94 forks source link

[BUG] my fzf search results display irregularities in iTerm2 #364

Closed littlecorgi-twk closed 7 months ago

littlecorgi-twk commented 1 year ago

Describe the bug

image

When I input any command and then press the tab key, several additional lines are displayed.

I can make sure:

Environment:

Minimal zshrc

# 应用bash文件里面的配置
source ~/.bash_profile
# 应用spaceship的配置
source ~/.spaceship-prompt
# 应用zinit
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

# 配置
# 修复zsh缺省的问题:https://blog.csdn.net/qq_36148847/article/details/79260745
setopt no_nomatch

# 主题
zinit light spaceship-prompt/spaceship-prompt
# 加载 OMZ 框架及部分插件
zinit snippet OMZ::lib/completion.zsh
zinit snippet OMZ::lib/history.zsh
# OMZgit辅助
zinit light aeons/omz-git
# fzf,必须在autosuggestions和highlighting之前加载
zpcompinit; zpcdreplay #必须加这一行,否则fzf-tab按下tab后会报错
zinit light Aloxaf/fzf-tab
# 自动补全
zinit light zsh-users/zsh-autosuggestions
# 语法高亮
zinit light zdharma-continuum/fast-syntax-highlighting
# 查找历史,务必放在高亮后面
zinit light zsh-users/zsh-history-substring-search
# 历史记录
zinit load zdharma-continuum/history-search-multi-word
# z
zinit ice lucid wait='0'
zinit light agkozak/zsh-z
# ls高亮
zinit light zpm-zsh/ls

# 绑定历史记录快捷键
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down

### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
    print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
    command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
    command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
        print -P "%F{33} %F{34}Installation successful.%f%b" || \
        print -P "%F{160} The clone has failed.%f%b"
fi
Aloxaf commented 1 year ago

Plesae trigger completion with Ctrl+X . and provide the log

littlecorgi-twk commented 1 year ago

zsh-22964-fzf-tab-2.log

littlecorgi-twk commented 7 months ago

Finally, I resolved this bug. The issue was caused by a setting in iTerm2 that I had enabled. iTerm2 -> Settings... -> Profiles -> Text -> Unicode -> Ambiguous characters are double-width.

After disabling this setting, the display returned to normal.