-
Notifications
You must be signed in to change notification settings - Fork 405
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
Delta appending ^[[OK at the end of each modified line ( color related i think ) #1490
Comments
Hi @ippsav, this is likely to be a problem with your environment (terminal emulator) since it hasn't been reported by other users.
Please try a different terminal emulator and see if you see the same problem. |
Terminal: alacritty Will try ! |
I'm encountering the same issue when I use the fish shell. It seems to make no difference if I use tmux or not. Emulator: kitty It works when I use zsh with iterm2. I've been searching through the fish shell github, but haven't found an obvious solution. Are you using fish shell as well @ippsav ? |
Hi @sophiabrandt, @ippsav. Hm, you probably already know this but for the record that code is ANSI CSI code "Erase in Line" (https://en.wikipedia.org/wiki/ANSI_escape_code). Delta uses it to cause the background colour to extend to the right-hand edge of the terminal window. FWIW I can't reproduce it with fish 3.6.1, Alacritty, MacOS M2, with or without tmux. |
@sophiabrandt i am using zsh, it's weird i think it's related to terminal settings, or tmux settings with color stuff |
@dandavison in any case, many thanks for your work on delta. ❤️ |
@ippsav @sophiabrandt do you use I saw the same strange rendering problem, and I finally narrowed it down to I fixed it by configuring delta to use less in my [delta]
pager = less @dandavison I found this in the README for bat:
Maybe it would make sense for delta to do the same? |
@michenriksen yes! That's it! Thank you. Never would have thought of the pager... 😅 |
@michenriksen Worked for me as well thanks man ! |
Excellent, thanks @michenriksen! Yeah I'm not quite sure where to slot in this advice; I don't think the README instructions should recommend [delta]
pager = less Since IIRC that overrides less config the user might have e.g. in the I think that the best solution for this is @clnoll's |
@dandavison yeah, adding
|
@michenriksen Right, thanks I think that's a great idea. Researching briefly, it looks like if we change the entry for the bat crate in Cargo.toml to bat = { version = "0.23.0", default-features = false, features = ["minimal-application", "paging", "regex-onig"] } Then the Backstory: when I first wrote delta, bat didn't exist as a library, and I copied/vendored some bat code dealing with invoking the pager (delta also uses bat's awesome collection of syntax highlighting assets of course). Subsequently, bat became available as a library, and as they make things available in the library, delta is trying to use them from the library. Delta's copied/vendored bat code is in If anyone would like to make the change I'm suggesting here that would be fantastic. |
[Closed since this issue is solved, but very happy for discussion to continue.] |
@dandavison that sounds like something nice to try to do, i ll give it a try ! |
@ippsav excellent, thanks! |
@dandavison I ve been reading the code trying to get the hang of it, i ll be making a pr soon i ll keep you updated it seems to be solved ! |
@dandavison ready for review keep me updated ! |
Nice one, @ippsav! 👏 |
@michenriksen thanks man |
Turns out this was because of using most as default pager. See dandavison/delta#1490 for full discussion.
Delta version:
delta 0.16.5
The text was updated successfully, but these errors were encountered: