Git trims the last character of content from remotes
- From
- Hugo Osvaldo Barrera <hugo@whynothugo.nl>
- Date
- May 4, 2026, 17:01 UTC
- Message-ID
- <2d3f5504-f5dd-4171-96e8-b5633b6a1f5e@app.fastmail.com>
Hi all,
When I push content to GitLab, the remote server sends back some text which git then prints to stderr:
remote: remote: To create a merge request for zk, visit: remote: https://gitlab.alpinelinux.org/WhyNotHugo/aports/-/merge_requests/new?merge_request%5Bsource_branch%5D=zk remote:
When the width of a whole line is the same as my terminal width, the last digit gets trimmed off. E.g.: if I resize my terminal for the above to fix exactly, and re-run the same command, git prints:
remote: https://gitlab.alpinelinux.org/WhyNotHugo/aports/-/merge_requests/new?merge_request%5Bsource_branch%5D=z
From what I can tell, sideband.c prints ANSI_SUFFIX = "\033[K", this escape sequence being "clear the line from the current position until the end of the line", and this is the root cause of the issue.
When piping to cat or to a file, this sequence is not printed, so the output is fine.
Is this a bug?
Thanks,
PS: please CC me, as I am not subscribed to the list.
-- Hugo