shell 终端ANSI转义码不起作用

bxgwgixi  于 2023-03-30  发布在  Shell
关注(0)|答案(1)|浏览(154)

当我在使用Arcanist登陆一些代码时,我发现我的终端无法逃脱颜色。<ESC>[1;32m9912da1<ESC>[m应该是32m9912da1或类似的东西。这是我的终端的问题吗?我的其他同事没有发现这个问题。

Landing current branch 'some-branch'.
 TARGET  Landing onto "master", selected by following tracking branches upstream to the closest remote.
 REMOTE  Using remote "origin", selected by following tracking branches upstream to the closest remote.
 FETCH  Fetching origin/master...
These commits will be landed:

      - <ESC>[1;32m9912da1<ESC>[m some commit
      - <ESC>[1;32m687f799<ESC>[m some other commit
vcudknz3

vcudknz31#

如果你在windows上使用arcanist和git bash,这应该可以解决这个问题:

# add the following function to your .bash_profile
function arc(){
    command arc --ansi $@|cat
}

有关详细说明,请参见:https://thomas-barthelemy.github.io/2015/04/23/phabricator-arcanist-gitbash/

相关问题