mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 05:57:38 -04:00
ConPTY doesn't carry a diff renderer's output to us as the renderer wrote it. It parses the output into a screen buffer and re-encodes that for the terminal side, and a sequence it can't represent there goes out the moment it is parsed, separately from the text around it. The OSC 1717 records a renderer states its diff lines in therefore arrive detached from the rows they describe, and the identity layer attributes rows to the wrong diff line or to none. Feed the renderer through a pipe there instead, so that its bytes reach us unaltered. A stdin filter becomes a command of our own, since git only invokes the one named by GIT_PAGER when it talks to a terminal; an external diff renderer is git's own business either way and needs nothing but the pipe. Unix keeps the pty. A renderer reads the width to lay out to off it, so taking it away would leave every configuration that doesn't name a width rendering at whatever the renderer falls back to, and diff renderers have worked on Unix far too long for that. LAZYGIT_RENDER_WITHOUT_PTY asks for the piped path anyway, which is how the integration tests cover it on a platform where they run at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>