Question about garbled ANSI codes when running 'gh' inside fzf's execute
action.
#4467
-
Run the command below and notice the issue: output=$(fzf --bind "start:execute(gh --version)+accept")
# ^[]11;rgb:2137/22df/298c^G^[[2;1R^[]11;rgb:2137/22df/298c^G^[[2;1Rgh version 2.76.0 (2025-07-17)
# https://github.com/cli/cli/releases/tag/v2.76.0
# 11;rgb:2137/22df/298c[2;1R11;rgb:2137/22df/298c[2;1R
echo $?
# 1 It used to work fine with older output=$(fzf --bind "start:execute(bin/gh --version)+accept")
# gh version 2.69.0-3-gcf3f0ee6b8dd (2025-07-23)
# https://github.com/cli/cli/releases/latest
echo $?
# 0 The problematic behavior in First: output=$(fzf --bind "start:execute(bin/gh --version)+accept")
# gh version 2.69.0-4-g6355e54e3cc1 (2025-07-23)
# https://github.com/cli/cli/releases/latest
# 11;rgb:2137/22df/298c[21;1R
echo $?
# 1 # ✅ NO_COLOR=1
output=$(fzf --bind "start:execute(NO_COLOR=1 bin/gh --version)+accept")
# gh version 2.69.0-4-g6355e54e3cc1 (2025-07-23)
# https://github.com/cli/cli/releases/latest
echo $?
# 0 Second: A new dependency, 'bubbletea', was added. It performs its own terminal query, which cannot be disabled by output=$(fzf --bind "start:execute(bin/gh --version)+accept")
# ^[]11;rgb:2137/22df/298c^G^[[59;1R^[]11;rgb:2137/22df/298c^G^[[59;1Rgh version 2.69.0-28-g202c1ad16b78 (2025-07-23)
# https://github.com/cli/cli/releases/latest
# 11;rgb:2137/22df/298c[59;1R11;rgb:2137/22df/298c[59;1R
echo $?
# 1 output=$(fzf --bind "start:execute(NO_COLOR=1 bin/gh --version)+accept")
# gh version 2.69.0-28-g202c1ad16b78 (2025-07-23)
# https://github.com/cli/cli/releases/latest
# 11;rgb:2137/22df/298c[59;1R
echo $?
# 1 # ✅ TERM=dumb
output=$(fzf --bind "start:execute(TERM=dumb bin/gh --version)+accept")
# gh version 2.69.0-28-g202c1ad16b78 (2025-07-23)
# https://github.com/cli/cli/releases/latest
echo $?
# 0 Using an ../fzf/bin/fzf --version
# 0.52.1 (d4216b0d)
output=$(../fzf/bin/fzf --bind "start:execute(bin/gh --version)+accept")
echo $?
# 1 output=$(../fzf/bin/fzf --bind "start:execute(bin/gh --version >/dev/tty)+accept")
# ^[]11;rgb:2137/22df/298c^G^[[7;1R^[]11;rgb:2137/22df/298c^G^[[7;1Rgh version 2.69.0-28-g202c1ad16b78 (2025-07-23)
# https://github.com/cli/cli/releases/latest
# 11;rgb:2137/22df/298c[7;1R11;rgb:2137/22df/298c[7;1R
echo $?
# 1 This issue does not occur with @junegunn, what is the best way for a user to address this? Should I file an issue with the I am a bit unsure about who needs to take action in this case and am just looking for guidance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Thanks for the heads-up. Yes, I can reproduce the problem (but not when I'm on tmux for some reason).
I really hope so, but I'm not sure at this point. I'll have to investigate. |
Beta Was this translation helpful? Give feedback.
A minimal repro (without fzf):