From 30fdd9bd68b2961ef87377177cf11fad53e3a6f1 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Tue, 1 Dec 2026 19:22:24 +0000 Subject: [PATCH] Fix Codex keyboard input when launching from a piped installer (#65093) ## Why When the installer runs through a pipe, Codex inherits the pipe as standard input and cannot read keystrokes from the terminal. ## What changed Keep standard input when it is already a terminal. Otherwise, launch Codex with input from `/dev/tty`. On macOS, open the controlling terminal device directly because polling `/dev/tty` for keyboard events is unsupported. GitOrigin-RevId: 382436320b801f499dd8ae3de288f42c4cb503f2 --- scripts/install/install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/install/install.sh b/scripts/install/install.sh index fed4c49770..f5d536331b 100755 --- a/scripts/install/install.sh +++ b/scripts/install/install.sh @@ -1085,7 +1085,15 @@ print_launch_instructions() { maybe_launch_codex_now() { if prompt_yes_no "Start Codex now?"; then step "Launching Codex" - "$BIN_PATH" + if [ -t 0 ]; then + "$BIN_PATH" + elif [ "$os" = "darwin" ]; then + # macOS can't poll /dev/tty for keyboard events. Open the controlling device directly. + launch_tty="$(ps -p "$$" -o tty= | awk '{print $1}')" + "$BIN_PATH" <"/dev/$launch_tty" + else + "$BIN_PATH"