Shorten the diff-metadata env var to OSC1717_METADATA

Pager authors reviewing the protocol asked to drop the EMIT_ prefix: the
OSC number already names the protocol, so EMIT_ was redundant. Rename the
handshake variable to OSC1717_METADATA in the spec and in the two places
lazygit advertises it (the pager PTY and the metadata probe).
This commit is contained in:
Stefan Haller 2026-07-02 16:23:15 +02:00
parent 7f5296205d
commit f8fe248678
3 changed files with 5 additions and 5 deletions

View file

@ -76,7 +76,7 @@ stays in the pager, which is the only component that has it.
## 3. Negotiation handshake
```
EMIT_OSC1717_METADATA = V1[,V2,…]
OSC1717_METADATA = V1[,V2,…]
```
- The **host** sets this environment variable on the pager subprocess to the list
@ -404,7 +404,7 @@ mapping; recorded as a v2 candidate, not taken (§9).
in the large empty 14005000 band (only iTerm2's `1337` is nearby). There is no
central registry, so this is "verified unused across the terminals that matter,"
not "allocated." If you know of a terminal that interprets `1717`, please say so.
2. **The env-var name and grammar** (`EMIT_OSC1717_METADATA=V1,…`).
2. **The env-var name and grammar** (`OSC1717_METADATA=V1,…`).
3. **The token-vs-line mismatch** (§8) — should there be an `m` type, or is
host-side inference the right home for it?
4. **Can your pager actually produce all four fields per region?** In particular

View file

@ -34,7 +34,7 @@ const metadataHandshake = "\x1b]1717"
// caches it per pager.
//
// No PTY is needed: git needs a terminal to decide to invoke a pager, but the pager
// itself emits the handshake whenever EMIT_OSC1717_METADATA is set, so we can run it
// itself emits the handshake whenever OSC1717_METADATA is set, so we can run it
// directly with empty input.
//
// A git-config external diff driver (useExternalDiffGitConfig) is chosen per file via
@ -75,7 +75,7 @@ func (self *DiffCommands) externalDiffEmitsMetadata(extDiffCmd string) bool {
}
func (self *DiffCommands) probeEmitsMetadata(cmdObj *oscommands.CmdObj) bool {
cmdObj.AddEnvVars("EMIT_OSC1717_METADATA=V1")
cmdObj.AddEnvVars("OSC1717_METADATA=V1")
// The pager may exit non-zero on the synthetic input; we only care about whether
// it emitted the handshake first, and the output is captured either way.
output, _ := cmdObj.RunWithOutput()

View file

@ -105,7 +105,7 @@ func (gui *Gui) newPtyTask(view *gocui.View, cmd *exec.Cmd, prefix string) error
// an OSC sequence we can read back (see diff-line-metadata-notes.md). A
// pager that doesn't understand it ignores the variable, so this is safe to
// set unconditionally.
cmd.Env = append(cmd.Env, "EMIT_OSC1717_METADATA=V1")
cmd.Env = append(cmd.Env, "OSC1717_METADATA=V1")
manager := gui.getManager(view)