-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Printing colored ANSI text terminated with reset sequence from a git hook prints (B to the command log in lazygit
Regression in 0.58.0: the command log also mangles the line breaks, making git hooks outptu unreadable in the log window
To Reproduce
To reproduce both the clobbered output and color issue:
- create new empty repository
- add the following pre-commit hook:
#!/bin/sh
echo "Testing progress bar:"
echo -ne '$##### (33%)\r'
sleep 1
echo -ne '############# (66%)\r'
sleep 1
echo -ne '####################### (100%)\r'
echo -ne '\n'
echo "this should work"
echo "$(tput setaf 1)This text is red$(tput sgr0)"
- Create a new commit and see the output in command log is clobbered (old screenshot without last echo with colored, but if you run it you will see):
- Running the hook manually from terminal with
.git/hooks/pre-commitprints expected:
./pre-commit
Testing progress bar:
####################### (100%)
this should work
Expected behavior
Regular colored text should be printed and line endings displayed normally
Screenshots
weird rendering of tput sgr0 (formatting reset sequence):
Below is regression in 0.58.0 when running pre-push hook containing uv run pipenv (it displays interactive progress bar)
command log from 0.57.0:
Same output at 0.58.0:
Version info:
commit=17d03ec8cb89d4c65fd129228164562a220abefb, build date=2025-12-06T13:01:50Z, build source=binaryRelease, version=0.57.0, os=linux, arch=amd64, git version=2.43.0- also on
commit=a0e81c93b89ccb13efe186d057505c624fb1e4ec, build date=2026-01-03T19:26:24Z, build source=binaryRelease, version=0.58.0, os=linux, arch=amd64, git version=2.43.0 git version 2.43.0
Additional context
N/A
Note
Please try updating to the latest version or manually building the latest master to see if the issue still occurs.
FelipeSharkao
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working