Skip to content

Terminal leaks OSC 11 + DA1 query responses into shell input after foreground process exits (reproducible with delta as git pager, and with vim via git rebase -i) #4041

Closed as duplicate

Description

@viddo

Summary

In a Superset terminal pane, running git diff with delta as the git pager leaves stray characters at the next shell prompt, like:

11;rgb:1515/1111/101062;4;9;22c

These are terminal capability responses (background color and device attributes) that delta asks for on startup. Superset isn't fully consuming them, so they leak into the shell as if typed. The same delta setup works correctly in iTerm2 on the same machine, so this looks like a Superset terminal bug rather than a delta one. Also reproduces with vim as the git editor (e.g. git rebase -i), pointing at the same root cause via a different trigger.

Relationship to #4013

#4013 (filed recently by @wesm) reports the same family of bug, with the same 1515/1111/1010 background-color values. Likely the same root cause. Filing this as a separate issue rather than a comment because the user-visible symptoms differ enough to track independently:

  • Terminal duplicates CSI 6n response after OSC 11 query #4013 uses a synthetic Go program that reads the responses correctly but observes the cursor-position response being duplicated on the wire.
  • This issue is a real-world trigger (delta + git diff) where the responses leak past the foreground process entirely and land at the shell prompt as input.
  • DA1 angle is new. Terminal duplicates CSI 6n response after OSC 11 query #4013 covers OSC 11 + CSI 6n. The leak here shows OSC 11 + DA1 (ESC[?62;4;9;22c) running together, which suggests the bug isn't specific to CSI 6n — it's any response following an OSC 11 in the same probe burst.

If they share a fix, great. If not, both surfaces are tracked.

Steps to reproduce

  1. Install delta: brew install git-delta
  2. In ~/.gitconfig:
    [core]
        pager = delta
  3. Open a Superset terminal pane, cd into any git repo
  4. Run git diff — leak appears at the next prompt
  5. Run git diff HEAD~1..HEAD (or any range with output) — leak appears on the command line below the diff output, blocking the next prompt from rendering cleanly

The bug shows up whether or not the diff has content. The trigger is delta starting up and querying the terminal, not the diff itself.

For a self-contained repro without delta, see the Go program in #4013.

Alternative trigger (no delta needed, requires vim as git editor):

  1. Ensure git uses vim as the editor: git config --global core.editor vim (or have EDITOR=vim / GIT_EDITOR=vim in your shell). Default macOS git already uses vim via /usr/bin/vi, so most setups hit this without extra config.
  2. Open a Superset terminal pane, cd into any git repo with at least 1 commit
  3. Run git rebase -i HEAD~1 — vim opens the rebase todo, probes the terminal, leak appears at the prompt after :wq (commit count doesn't matter, HEAD~1 is enough)

What the leaked text means

11;rgb:1515/1111/101062;4;9;22c
  • 11;rgb:1515/1111/1010 — the terminal's reply to delta's "what's your background color?" query (OSC 11). The leading escape character was consumed; the payload was not.
  • 62;4;9;22c — the terminal's reply to delta's "what device are you?" query (DA1, normally ESC[?62;4;9;22c). Same shape: prefix consumed, payload leaked.

Delta sends both queries back-to-back at startup to pick a light/dark theme and color mode.

Also reproduces with vim (different trigger, same root cause)

git rebase -i HEAD~1 in a Superset pane leaks .,.+111$y at the prompt after the editor exits. Trigger is vim's startup terminal probes, not delta. Confirms the leak isn't specific to delta — any foreground process that queries the terminal at startup hits it.

On macOS, /usr/bin/vi is symlinked to vim 9.1, so vi reproduces too. nano, code --wait, and zed --wait do not.

Expected

No stray text at the prompt. The replies should be consumed before control returns to the shell.

Actual

Reply payloads land at the shell prompt as if typed.

Environment

  • Superset 1.8.0 (also seen in earlier versions, at least a week back)
  • macOS 26.3.1 (Apple Silicon)
  • TERM=xterm-256color, COLORTERM=truecolor
  • SUPERSET_HOOK_VERSION=2
  • Shell: zsh
  • Repro tools: delta 0.18.2, git 2.53.0
  • Does not reproduce in iTerm2 or kitty on the same machine with the same config.

Related

Delta has had its own OSC 11 quirks historically (dandavison/delta#1707, dandavison/delta#1735), both fixed upstream. Current delta works correctly outside Superset on the same machine.

Activity

  1. added a commit that references this issue on May 4, 2026
  2. viddo commented on May 5, 2026

    @viddo
    Author

    re: delta, as workaround for now, using standard cat as pager, in ~/.zshrc:

    # Superset-spawned shells: disable git pager so agents/tools don't hang on less.
    # https://docs.superset.sh/terminal-integration
    [[ -n $SUPERSET_ROOT_PATH ]] && export GIT_PAGER=cat

    Don't rebase too often so not as annoying.

  3. changed the title [-]Terminal leaks OSC 11 + DA1 query responses into shell input after foreground process exits (reproducible with delta as git pager)[/-] [+]Terminal leaks OSC 11 + DA1 query responses into shell input after foreground process exits (reproducible with delta as git pager, and with vim via git rebase -i)[/+] on May 5, 2026
  4. Kitenite commented on May 6, 2026

    @Kitenite
    Member

    Related reports (cross-referenced during issue triage — same area, may or may not share a root cause):

  5. ajrobertsonio commented on May 12, 2026

    @ajrobertsonio

    Adjacent datapoint for the triage cross-ref: the same probe-response race manifests as outright hijacking of interactive child-process prompts when the next command is gh auth login or gh auth refresh. CPR rather than OSC 11 / DA1 in my case, but the timing and consequence are the same shape — response lands inside the child's stdin read instead of between commands.

    Full reproduction posted at #3325 — gh auth refresh aborts with could not prompt: unexpected escape sequence from terminal: ['\x1b' ']']; gh auth login arrow-select gets pre-filled with 1R, Y/n gets pre-filled with 56R56R. Adding here since this looks like the active thread.

  6. Kitenite commented on Jul 11, 2026

    @Kitenite
    Member

    Closing as a duplicate of #5604, the consolidated tracker for stale terminal-input issues from the July 2026 stale-issue sweep (no activity since 2026-06-01). If this still applies on a current build, comment on #5604 and we'll reopen.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions