spaceship-prompt: BUG: zsh-autocomplete overwrites prompt and previous terminal output

Current behavior Here’s a video showing what happens when using zsh-autocomplete with spaceship- prompt. I’ve never observed this behavior with any other prompt.

https://www.dropbox.com/s/kaoapprse378ci1/spaceship-bug.mov?dl=0

Expected behavior

The autocomplete suggestions should be shown under the prompt, as opposed to overwriting them.

Relevant Zsh configuration (.zshrc)

# .zshrc
# Author: Aaron Lichtman

export ZSH=/Users/alichtman/.oh-my-zsh
export GOPATH="$GOPATH:$HOME/go"
export GOBIN="$GOPATH/bin"

ZSH_THEME="spaceship"
# ZSH_THEME="agnoster"
# ZSH_THEME="bullet-train"
# ZSH_THEME="hyperzsh"
# ZSH_THEME="wezm"
# ZSH_THEME="kolo"

###
# Spaceship config
###

SPACESHIP_TIME_SHOW=false
SPACESHIP_DIR_TRUNC_PREFIX=""
SPACESHIP_DIR_COLOR="yellow"
SPACESHIP_GIT_BRANCH_COLOR="cyan"
SPACESHIP_CHAR_SYMBOL="➜ "

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'

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

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

# 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
  zsh-autosuggestions
  zsh-syntax-highlighting
)

source $ZSH/oh-my-zsh.sh

# Autojump
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh

# thefuck integration.
eval $(thefuck --alias)

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="$PATH:/usr/local/bin"

# Clean up prompt
prompt_context() {}

# pip zsh completion start
function _pip_completion {
  local words cword
  read -Ac words
  read -cn cword
  reply=( $( COMP_WORDS="$words[*]" \
             COMP_CWORD=$(( cword-1 )) \
             PIP_AUTO_COMPLETE=1 $words[1] ) )
}
compctl -K _pip_completion pip
# pip zsh completion end

# Alias rm to trash
if [ -f /usr/local/bin/trash ]; then alias rm="/usr/local/bin/trash"; fi
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Environment

Spaceship version: 3.7.0 Zsh version: zsh 5.3 (x86_64-apple-darwin17.0) Zsh framework: oh-my-zsh Zsh plugin manager: None Terminal emulator: Terminal.app on MacOS Operating system: macOS

Video

https://www.dropbox.com/s/kaoapprse378ci1/spaceship-bug.mov?dl=0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Thank you for the report and demo @alichtman, I’m not sure this is behavior is consistent. For instance I use zsh-autosuggestions with spaceship, But haven’t had this issue yet. Also autosuggestions have issue with several themes, We’ll surely look into it if this can be fixed from spaceship.

I figured out that zsh at /bin/zsh was being not used, and /usr/local/bin/zsh was where homebrew installed it. I set the shell path to be this:

image

And everything works now. Thanks for the help, everyone.

This isn’t an issue with spaceship-prompt but figuring out how to fix the issue took some digging. The fix mentioned above did not help. Disabling COMPLETION_WAITING_DOTS did the trick. See https://github.com/robbyrussell/oh-my-zsh/issues/5765

FWIW I also use zsh-autosuggestions with spaceship and I’ve never seen this issue.

After upgrading to Zsh 5.6.2, Make sure to set it as default and verify with $ZSH_VERSION. We’re sorry about the issue, But there isn’t much we can do until we can reliably reproduce this.