Change env var from OSC1717_METADATA to OSC1717

This commit is contained in:
Stefan Haller 2026-07-17 08:32:46 +02:00
parent 1fcbc4d5a5
commit 18e4dba0be
2 changed files with 3 additions and 3 deletions

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 OSC1717_METADATA is set, so we can run it
// itself emits the handshake whenever OSC1717 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("OSC1717_METADATA=V1")
cmdObj.AddEnvVars("OSC1717=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, "OSC1717_METADATA=V1")
cmd.Env = append(cmd.Env, "OSC1717=V1")
manager := gui.getManager(view)