-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 git's --color-moved with DOS line endings (\r\n) triggers a panic #795
Comments
Thanks @th1000s. This is happening because git (for some reason -- does anyone know why? Is it intentional?) inserts ANSI escape sequences (in this case a "reset" command) between the \r and \n. This behavior of git was noted in #664.
Fixed in #800 by doing the \r-stripping on the raw line, accounting for the possibility of trailing ANSI escape sequences. |
My guess is this is a bug in git -- failing to account for the possibility of \r\n endings when inserting a reset ANSI code, but terminal emulators tolerate it. It looks like the relevant code is here: https://github.com/git/git/blob/9865b6e6a4ca1e895fd473c827cf1822f3bd8249/diff.c#L1920-L1933 Maybe the line endings are supposed to be normalized prior to that point? |
Using delta 92d6591 and git version 2.30.2. To reproduce:
The text was updated successfully, but these errors were encountered: