Skip to content

[BUG] Extra space gets prepended to completion if left- and right-prompts are present (starship) #535

@felciano

Description

@felciano

Describe the bug

When using fzf-tab with starship, completion adds an extra space at the beginning of the line, indenting the whole line. This then messes up in-line editing and display.

This is with v1.2.0-4-gfc6f0dc

I can make sure:

  • I am using the latest version of fzf-tab
  • this is the minimal zshrc which can reproduce this bug
  • fzf-tab is loaded after compinit
  • fzf-tab is loaded after plugins which will wrap Tab, like junegunn/fzf/completion.zsh
  • fzf-tab is loaded before zsh-autosuggestions, zsh-syntax-highlighting and fast-syntax-highlighting.

To Reproduce

Steps to reproduce the behavior on MacOS:

  1. Start from the prompt >
  2. Type > ~/Down
  3. Press Tab
  4. See correct completion but with extra space at the front: > ~/Downloads

The text is indented, but the cursor seems to still think the text is in its old location (no space added). So now typing/deleting messes up the text.

I believe this is an interaction between

  • oh-my-zsh (problem goes away if you turn of OMZ)
  • starship with the right prompt visible (problem goes away if you turn off the right prompt)
  • fzf-tab (problem doesn't occur if you use default OMZ completion)

Expected behavior

I expect the completion to give me the right directory name without shifting the whole line: > ~/Downloads

Screenshots

This screen recording shows the issue: https://share.cleanshot.com/KCrmClHJ

Environment:

  • OS: MacOS
  • zsh version: zsh 5.9 (arm64-apple-darwin24.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions