From 8ae1a5c766125934f5f51644537dbf0299bc297b Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 8 Jun 2026 09:31:31 +0100 Subject: [PATCH] fix(dogfood/coder): disable gh terminal color probes (#26114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer GitHub CLI versions probe terminal colors before interactive prompts, which can leave OSC responses in dogfood web terminal stdin and break `gh auth login`. Default `NO_COLOR=1` inside the dogfood `/usr/local/bin/gh` wrappers when callers have not set it themselves. This avoids the color probe without pinning or downgrading `gh`, and keeps the existing Coder external-auth wrapper behavior intact. Refs ENG-2842. > 🤖 Generated by Coder Agents on behalf of @johnstcn. --- dogfood/coder/ubuntu-22.04/files/usr/local/bin/gh | 5 +++++ dogfood/coder/ubuntu-26.04/files/usr/local/bin/gh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/dogfood/coder/ubuntu-22.04/files/usr/local/bin/gh b/dogfood/coder/ubuntu-22.04/files/usr/local/bin/gh index 8d8168c70b..badd7306ce 100755 --- a/dogfood/coder/ubuntu-22.04/files/usr/local/bin/gh +++ b/dogfood/coder/ubuntu-22.04/files/usr/local/bin/gh @@ -10,6 +10,11 @@ REAL_GH="/usr/bin/gh" +# ENG-2842: prevent gh from probing terminal colors before interactive prompts. +if [ -z "${NO_COLOR+x}" ]; then + export NO_COLOR=1 +fi + # If GH_TOKEN or GITHUB_TOKEN is already set, defer to the real gh. if [ -n "${GH_TOKEN:-}" ] || [ -n "${GITHUB_TOKEN:-}" ]; then exec "$REAL_GH" "$@" diff --git a/dogfood/coder/ubuntu-26.04/files/usr/local/bin/gh b/dogfood/coder/ubuntu-26.04/files/usr/local/bin/gh index 8d8168c70b..badd7306ce 100755 --- a/dogfood/coder/ubuntu-26.04/files/usr/local/bin/gh +++ b/dogfood/coder/ubuntu-26.04/files/usr/local/bin/gh @@ -10,6 +10,11 @@ REAL_GH="/usr/bin/gh" +# ENG-2842: prevent gh from probing terminal colors before interactive prompts. +if [ -z "${NO_COLOR+x}" ]; then + export NO_COLOR=1 +fi + # If GH_TOKEN or GITHUB_TOKEN is already set, defer to the real gh. if [ -n "${GH_TOKEN:-}" ] || [ -n "${GITHUB_TOKEN:-}" ]; then exec "$REAL_GH" "$@"