zsh tab completion bug on ubuntu
Asked Answered
C

2

9

I'm getting a really annoying bug here:

% git s<TAB> becomes

% git   sgit  s  
send-email   -- send collection of patches as emails  
send-pack     -- push objects over git protocol to another repository  
...

It just duplicates the command. If I resize the screen, it goes back to normal: git s

How do I fix this?

Camaraderie answered 21/6, 2012 at 20:34 Comment(6)
What is your TERM environment variable? Which terminal are you using?Tonitonia
I'm just using the default ubuntu terminal. my TERM is xtermCamaraderie
What is the default Ubuntu terminal?Tonitonia
Hrm, I can't reproduce that problem on my Ubuntu 12.04 using gnome-terminal, TERM=xterm, and zsh. If you can't solve this problem use ^L to ask for a terminal re-draw each time it happens. It'll be way faster than resizing the window.Tonitonia
Yep ^L does the trick. But I'd like to fix this stupid bug :(Camaraderie
Should be on Ask Ubuntu websiteGastrulation
C
9

I got it! Darn. It's my prompt

instead of:

PS1=$'%B%F{$fg[green]%}${PWD/#$HOME/~}%{$reset_color%}`git-prompt` ${VIMODE} '

I should just do

PS1=$'%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}`git-prompt` ${VIMODE} '

And everything works fine now...

Camaraderie answered 21/6, 2012 at 22:5 Comment(0)
I
1

I had this problem on macOS, and would like to share how I fixed it.

As far as I can tell, this happens when there is some problem with your custom prompt. I had:

PROMPT='%{$fg[green]%}%n@%m%{$reset_color%}:%{$fg[cyan]%}${(%):-%~}$reset_color%}$ '

And after close inspection, I noticed that the last colour change ($reset_color) was incorrectly wrapped. I then changed the prompt like so:

PROMPT='%{$fg[green]%}%n@%m%{$reset_color%}:%{$fg[cyan]%}${(%):-%~}%{$reset_color%}$ '

And I no longer had the issue.

Infanta answered 17/11, 2020 at 9:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.