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) <noreply@anthropic.com>
This commit is contained in:
fvallenilla 2026-03-17 18:50:11 -06:00 committed by GitHub
parent dfbd238e47
commit aefb7767f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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.
#

View file

@ -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.
#