Repository navigation
Conversation
LazyGit 0.66 stages from its diff panel and keeps a renderer's output only when each row carries OSC 1717 metadata; otherwise it falls back to plain git diff. When the host sets OSC1717 to a version set including V1, the pager always renders statically, writes the handshake first (also for the empty-stdin probe), and tags file headers, hunk headers, and content rows, one record per split column. Without the variable, output is unchanged. Refs modem-dev#1340 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moh682
marked this pull request as ready for review
November 19, 2026 12:29
Contributor
|
This PR does not match any of the 1 configured review trigger rule. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1340 (draft until the proposal there is agreed).
Problem
LazyGit 0.66 stages hunks and lines straight from its diff panel. It keeps a diff renderer's output while staging only when the renderer tags rows with OSC 1717 diff line metadata; otherwise it swaps in plain
git diff. So withhunk pageras LazyGit's renderer, pressing Enter on a file dropped Hunk's rendering.Approach
core/process/diffLineMetadata.tsnegotiates the version fromOSC1717(aV1[,V2,…]set) and formats the handshake and per-row records. Nothing is emitted without a shared version, so output elsewhere is byte-for-byte unchanged.app/startup.ts: a negotiating host always gets the static pager, and the handshake is written even for non-diff or empty stdin. LazyGit probes support by running the pager on empty stdin with stdout captured, which previously took the plain-text path.ui/staticDiffPager.tstags rows using the existing row model:fon the file header,hwith the hunk's first new-file line,c/a/don content rows. Deletions take their new-file position from Pierre's hunk blocks per §5.3, so consecutive deletions share a new line. Split rows carry one record per column; blank halves, collapsed gaps and expansion rows stay untagged. The handshake also precedes the raw-patch fallback.Non-goals: the interactive UI and other headless commands are untouched. Paths with control characters get no record rather than a broken escape sequence.
It lives in core because it is the static pager's output contract with the host, not an opt-in workflow.
Verification
macOS (arm64) only; Linux and Windows not tested.
bun run typecheck,bun run lint,bun run deps:check,bun run format:check: pass.core/process/diffLineMetadata.test.ts, plus cases inui/staticDiffPager.test.ts(unified, split, deleted file at new line 0, handshake on fallback, no output without negotiation) andapp/startup.test.ts(negotiated patch, empty-stdin probe, no shared version). 68/68 pass across those files.bun run test: 5897 pass, 11 fail. The failures are inextensions/installedPackageResolution,extensions/hostRuntimeModules,core/watch/observer.fs,app/documents/filesystemSource.observe,session/broker/brokerLauncherandui/AppHost.reload. Running those files on unmodifiedmainon the same machine gives 75 pass / 12 fail with the same tests failing.bun run test:integrationandbun run test:tty-smoke. Static pager output is not a PTY or interactive surface; happy to run them if you want them for this change.spaceon the first change stages exactly that block (-two -three +TWO) while+sixstays unstaged.Decoded output for a two-deletions-one-addition change:
Limitations
--no-hunk-headersthere is no hunk header row, so nohrecord is emitted.diff --cc) diffs get records from the same row model; I did not verify LazyGit's staging behaviour on them.🤖 Generated with Claude Code