commitizen / cz-cli

The commitizen command line utility. #BlackLivesMatter

Home Page:http://commitizen.github.io/cz-cli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible bug with terminal prompt colours?

afgallo opened this issue · comments

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!

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/

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

commented

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

commented

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