commitizen / cz-cli

The commitizen command line utility. #BlackLivesMatter
http://commitizen.github.io/cz-cli/
MIT License
16.77k stars 552 forks source link

Possible bug with terminal prompt colours? #939

Closed afgallo closed 2 years ago

afgallo commented 2 years ago

Hi there,

I have this weird behaviour where my terminal goes all fuzzy when I run commitizen through a husky hook. This doesn't happen when I run npx cz as per screenshot below:

image

What's interesting is that this had been working for a very long time. I wonder if this was a result of an update to latest commitizen version?

Environment info: MacOS 12.4 node 16.15 git 2.36.1 commitizen 4.2.4 cz-conventional-changelog 3.3.0

Husky hook:

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

exec < /dev/tty && npx cz --hook || true
# also tried exec < /dev/tty && node_modules/.bin/cz --hook || true

Thanks a lot for looking into this issue!

techmunk commented 2 years ago

This was casued by a change in git 2.36.0. Revet git to a version prior to this and you will see the issue "goes" away.

You can read more about it at https://lore.kernel.org/git/xmqqfskgz9sb.fsf@gitster.g/t/

afgallo commented 2 years ago

Thanks @techmunk, I've reverted to git version 2.32 (MacOS default) and it works now. I would've preferred to revert to a homebrew supported version but it seems they only have the latest

StErMi commented 1 year ago

is the "revert to old version" still the only solution?

ting772 commented 1 year ago

same problem,but i find a work-around,no need to revert to a version below 2.36.0, my screenshot shown as below image move up/down my arrow,another shot image

here is my code: image