From aefb7767f61e5c2b2837dd746e54decea87ad7f9 Mon Sep 17 00:00:00 2001 From: fvallenilla <168041581+fvallenilla@users.noreply.github.com> Date: Tue, 17 Mar 2026 18:50:11 -0600 Subject: [PATCH] fix: suppress socat stdout in _cmux_send to prevent "OK" leak (#1619) The socat path in _cmux_send did not redirect stdout/stderr, causing the cmux socket's "OK" response to print to the user's terminal on every shell integration event (new tab, cd, precmd, preexec). The ncat path avoids this via --send-only, and the nc path already redirects to /dev/null. This aligns the socat path with both. Fixes #1618 Co-authored-by: Claude Opus 4.6 (1M context) --- Resources/shell-integration/cmux-bash-integration.bash | 2 +- Resources/shell-integration/cmux-zsh-integration.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/shell-integration/cmux-bash-integration.bash b/Resources/shell-integration/cmux-bash-integration.bash index fc1d4cf1..46afa112 100644 --- a/Resources/shell-integration/cmux-bash-integration.bash +++ b/Resources/shell-integration/cmux-bash-integration.bash @@ -5,7 +5,7 @@ _cmux_send() { if command -v ncat >/dev/null 2>&1; then printf '%s\n' "$payload" | ncat -w 1 -U "$CMUX_SOCKET_PATH" --send-only elif command -v socat >/dev/null 2>&1; then - printf '%s\n' "$payload" | socat -T 1 - "UNIX-CONNECT:$CMUX_SOCKET_PATH" + printf '%s\n' "$payload" | socat -T 1 - "UNIX-CONNECT:$CMUX_SOCKET_PATH" >/dev/null 2>&1 elif command -v nc >/dev/null 2>&1; then # Some nc builds don't support unix sockets, but keep as a last-ditch fallback. # diff --git a/Resources/shell-integration/cmux-zsh-integration.zsh b/Resources/shell-integration/cmux-zsh-integration.zsh index af518b52..1bcf084f 100644 --- a/Resources/shell-integration/cmux-zsh-integration.zsh +++ b/Resources/shell-integration/cmux-zsh-integration.zsh @@ -6,7 +6,7 @@ _cmux_send() { if command -v ncat >/dev/null 2>&1; then print -r -- "$payload" | ncat -w 1 -U "$CMUX_SOCKET_PATH" --send-only elif command -v socat >/dev/null 2>&1; then - print -r -- "$payload" | socat -T 1 - "UNIX-CONNECT:$CMUX_SOCKET_PATH" + print -r -- "$payload" | socat -T 1 - "UNIX-CONNECT:$CMUX_SOCKET_PATH" >/dev/null 2>&1 elif command -v nc >/dev/null 2>&1; then # Some nc builds don't support unix sockets, but keep as a last-ditch fallback. #