'$ git' 自动完成功能似乎会打印颜色代码

'$ git' 自动完成功能似乎会打印颜色代码

当我$ git在 CLI 中输入内容并按下制表位进行自动完成时,我收到以下建议,看起来像是bash文本有额外的颜色突出显示。

$ git 
^[[01;31m^[[K                c^[[m^[[Kheckout-index       d^[[m^[[Kescribe             f^[[m^[[Ksck-objects         l^[[m^[[Kog                  notes                        stage
a^[[m^[[Kdd                  c^[[m^[[Kheck-ref-format     d^[[m^[[Kiff                 g^[[m^[[Kc                   l^[[m^[[Ks-files             pull                         stash
a^[[m^[[Km                   c^[[m^[[Kherry               d^[[m^[[Kiff-files           g^[[m^[[Ket-tar-commit-id    l^[[m^[[Ks-remote            push                         status
a^[[m^[[Knnotate             c^[[m^[[Kherry-pick          d^[[m^[[Kiff-index           g^[[m^[[Krep                 l^[[m^[[Ks-tree              rebase                       submodule
a^[[m^[[Kpply                c^[[m^[[Klean                d^[[m^[[Kifftool             h^[[m^[[Kash-object          mergetool                    reflog                       subtree
a^[[m^[[Krchive              c^[[m^[[Klone                d^[[m^[[Kiff-tree            h^[[m^[[Kelp                 m^[[m^[[Kailinfo             remote                       tag
b^[[m^[[Kisect               c^[[m^[[Kolumn               f^[[m^[[Kast-export          h^[[m^[[Kttp-backend         m^[[m^[[Kailsplit            repack                       verify-commit
b^[[m^[[Klame                c^[[m^[[Kommit               f^[[m^[[Kast-import          h^[[m^[[Kttp-fetch           m^[[m^[[Kerge                replace                      whatchanged 
b^[[m^[[Kranch               c^[[m^[[Kommit-tree          f^[[m^[[Ketch                h^[[m^[[Kttp-push            m^[[m^[[Kerge-base           request-pull                 worktree
b^[[m^[[Kundle               c^[[m^[[Konfig               f^[[m^[[Ketch-pack           i^[[m^[[Kmap-send            m^[[m^[[Kerge-file           reset
c^[[m^[[Kat-file             c^[[m^[[Kount-objects        f^[[m^[[Kilter-branch        i^[[m^[[Kndex-pack           m^[[m^[[Kerge-index          revert
c^[[m^[[Kheck-attr           c^[[m^[[Kredential           f^[[m^[[Kmt-merge-msg        i^[[m^[[Knit                 m^[[m^[[Kerge-octopus        rm
c^[[m^[[Kheck-ignore         c^[[m^[[Kredential-cache     f^[[m^[[Kor-each-ref         i^[[m^[[Knit-db              m^[[m^[[Kerge-one-file       shortlog
c^[[m^[[Kheck-mailmap        c^[[m^[[Kredential-store     f^[[m^[[Kormat-patch         i^[[m^[[Knstaweb             mv                           show
c^[[m^[[Kheckout             d^[[m^[[Kaemon               f^[[m^[[Ksck                 i^[[m^[[Knterpret-trailers   name-rev                     show-branch

例如,当我尝试git commit使用自动完成功能时,出现以下错误消息;git commit而手动输入则可以正常工作……

$ git c^[[m^[[Kommit
git: 'commit' is not a git command. See 'git --help'.

有人知道这种行为从何而来以及如何解决自动完成问题?

相关内容