Skip to content

OSC-1717 support for better integration in lazygit #2180

Closed

Description

@stefanhaller

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.

Activity

  1. jesseduffield commented on Jul 1, 2026

    @jesseduffield
    Contributor

    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.

  2. dandavison commented on Jul 2, 2026

    @dandavison
    Owner

    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.

  3. stefanhaller commented on Jul 2, 2026

    @stefanhaller
    ContributorAuthor

    That's great to hear, thanks. I opened #2181 for review.

  4. cschanhniem commented on Jul 8, 2026

    @cschanhniem

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions