kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.62k stars 986 forks source link

Tab completion bugged with zsh frameworks zim and Prezto #1395

Closed truongio closed 5 years ago

truongio commented 5 years ago

When you start writing a command and press tab, the thing you started writing stays in the screen and gets duplicated but it doesn't do anything. For example, if I start writing gi and press TAB, it will look like gigi on my screen and if I want to get it to say git, it will instead say gigit. Pressing enter still makes it behave as if I have typed git even though it says gigit. See GIF (Zim is used) for clarification.

out

kovidgoyal commented 5 years ago

I have no idea what frame zim and prezto are, I need a minimal .zshrc to reproduce your issue with, or otherwise use --dump-bytes with kitty to create a minimal dump file to recreate the issue.

truongio commented 5 years ago

My apologies, the title was incorrect. It was supposed to be "framework". They are configuration frameworks for zsh. https://github.com/zimfw/zimfw and https://github.com/sorin-ionescu/prezto

truongio commented 5 years ago

Can be recreated with this .zshrc

# zim
export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
[[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh

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

If I remove the zim part and use pure ZSH then it works correctly.

kovidgoyal commented 5 years ago

doesn't that require something in ~/.zim?

truongio commented 5 years ago

Yes, you need to install zim. https://github.com/zimfw/zimfw

truongio commented 5 years ago

I identified the module in ZSH that messes it up, it's https://github.com/zimfw/zimfw/blob/master/modules/prompt/README.md. If I turn that module off, it works. Seems to be the same bug in Hyper.js but works on iTerm2

truongio commented 5 years ago

Found a solution. Add following to .zshrc

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

https://github.com/sindresorhus/pure/issues/412 https://github.com/sindresorhus/pure/issues/300#issuecomment-328744993

lminer commented 4 years ago

I have this identical problem but only when I ssh into a remote server. Happens with ohmyzsh and pure prompt. Adding those two lines to my .zshrc does not fix anything.

kovidgoyal commented 4 years ago

Do this: https://sw.kovidgoyal.net/kitty/faq.html#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-when-sshing-into-a-different-computer

lminer commented 4 years ago

It works! I had to alter my path so that anaconda wasn't being used first.