Fish-shell: Git checkout alias, branch completion displays terminal codes

Created on 27 Nov 2017  ·  1Comment  ·  Source: fish-shell/fish-shell

Fedora 26
Fish 2.7.0 (fish-2.7.0-1.1.x86_64)
Git 2.13.6 (git-core-2.13.6-2.fc26.x86_64)

I have recently pulled in updates which have changed behaviour on Fedora 26.

Specifically, Git branch names are being displayed with terminal escape codes in them, when using a git alias. This wasn't happening with prior versions.

I have a git config file with a simple alias 'co = checkout'.

[alias]
        br = branch
        bra = branch -a
        bl = blame -wMC
    ci = commit -m
    cia = commit --amend -m
        cl = clone
        co = checkout

Which Fish displays correctly...

❱ git co
co  (Alias for checkout)

Previously (under Fish 2.6) I didn't have any problems with name completion. It would appear as expected:

❱ git co staging
ardrigh/production  (Remote Branch)
ardrigh/staging     (Remote Branch)

If I remove my git config file, and use the default, it works as expected again.

❱ git checkout 
ardrigh/production  (Remote Branch)
ardrigh/staging     (Remote Branch) 

Now with 2.7, using the same git config, I am seeing escape codes appear:

❱ git co 
\e\[31mardrigh/production\e\[m                (Remote Branch)
\e\[31mardrigh/staging\e\[m                   (Remote Branch)

What generates the completion of the git branch names? Is this a script I can try to fix, or something that's compiled?

I need to double-check on another machine without the fish shell update, but I don't believe this is Git's fault.

completions question

Most helpful comment

After checking options in my Git config, I think this clash appears to be with my git config using color.ui = always.

Changing the git config value to color.ui = true stops this from breaking. I feel like this is a safer option, so I'll close this issue.

>All comments

After checking options in my Git config, I think this clash appears to be with my git config using color.ui = always.

Changing the git config value to color.ui = true stops this from breaking. I feel like this is a safer option, so I'll close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elmigranto picture elmigranto  ·  3Comments

badp picture badp  ·  3Comments

krader1961 picture krader1961  ·  3Comments

zx8 picture zx8  ·  3Comments

Limeth picture Limeth  ·  3Comments