I had the same problem, and I was able to find a solution that doesn’t use a subshell:
set -x
command
{ set +x; } 2>/dev/null
I had the same problem, and I was able to find a solution that doesn’t use a subshell:
set -x
command
{ set +x; } 2>/dev/null