You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OSC-1717 support for better integration in lazygit #2180
Hi Dan, I'm the current maintainer of lazygit, and I have come up with a custom OSC protocol that improves the user experience of lazygit when custom pagers are used; see jesseduffield/lazygit#5732 for information about that, including a video that explains what this is about. Your feedback would be very welcome!
In case you are short on time: I want to make it very clear that this doesn't need any work from your side, apart from reviewing the PR that I'm going to post. If you want to give feedback on the approach, that would be very welcome, but if not, that's fine as well.
The main reason why I'm filing this issue (rather than simply open that PR) is that the work on the lazygit side is massive, and I don't want to start it before I have buy-in from the most important pager authors. I am eager to start it though, so if you could give your general ok, that would be great.
Hey @dandavison , just adding my +1 to this: I use Lazygit with delta every day and this change would massively improve my user experience along with many other users.
Hi @stefanhaller, thanks for the video! This looks like really innovative work and I'd be happy to help get this into delta. Your prototype PR looks clean to me, and of course it looks like it has no impact unless the env var is set. I haven't studied the spec yet, but you don't need to wait for me to do that -- please assume that I'll review and merge your PR and get it released once you say it's ready. The one comment that occurs to me so far is the name of the env var. It is currently EMIT_OSC1717_METADATA but I think I would suggest leading with "OSC1717", so perhaps just OSC1717_METADATA as the env var. Posted that suggestion to the spec PR.
I've reviewed the lazygit OSC protocol proposal. The key consideration for delta is that it currently processes output through a pager pipeline that strips unrecognized OSC sequences.
Delta already handles ANSI sequences for syntax highlighting via the ansi tokenizer in src/ansi.rs. Adding passthrough for specific OSC codes (OSC-1717 / \e]1717;...\a) would be a matter of recognizing them in the tokenizer's pass-through path and emitting them on stdout without modification.
Since delta sits as a pager in core.pager or core.pager = delta, the OSC sequences from lazygit's diff output would flow through delta's stdin→stdout pipeline. As long as delta doesn't strip them, lazygit's terminal consumer will see them. This is a clean addition that doesn't break existing highlighting behavior.
Activity
jesseduffield commentedon Jul 1, 2026
Hey @dandavison , just adding my +1 to this: I use Lazygit with delta every day and this change would massively improve my user experience along with many other users.
dandavison commentedon Jul 2, 2026
Hi @stefanhaller, thanks for the video! This looks like really innovative work and I'd be happy to help get this into delta. Your prototype PR looks clean to me, and of course it looks like it has no impact unless the env var is set. I haven't studied the spec yet, but you don't need to wait for me to do that -- please assume that I'll review and merge your PR and get it released once you say it's ready. The one comment that occurs to me so far is the name of the env var. It is currently
EMIT_OSC1717_METADATAbut I think I would suggest leading with "OSC1717", so perhaps justOSC1717_METADATAas the env var. Posted that suggestion to the spec PR.stefanhaller commentedon Jul 2, 2026
That's great to hear, thanks. I opened #2181 for review.
cschanhniem commentedon Jul 8, 2026
I've reviewed the lazygit OSC protocol proposal. The key consideration for delta is that it currently processes output through a pager pipeline that strips unrecognized OSC sequences.
Delta already handles ANSI sequences for syntax highlighting via the
ansitokenizer insrc/ansi.rs. Adding passthrough for specific OSC codes (OSC-1717/\e]1717;...\a) would be a matter of recognizing them in the tokenizer's pass-through path and emitting them on stdout without modification.Since delta sits as a pager in
core.pagerorcore.pager = delta, the OSC sequences from lazygit's diff output would flow through delta's stdin→stdout pipeline. As long as delta doesn't strip them, lazygit's terminal consumer will see them. This is a clean addition that doesn't break existing highlighting behavior.