On Sat, Oct 21, 2023 at 11:17:13PM +0700, Budi wrote:
> 1) When writing a prompt, in interactive mode.
> 2) When writing an error.
> 3) When writing xtrace lines, unless BASH_XTRACEFD is changed.
> 4) When writing job control messages.
>
> Imho, none for exact, but the combination simply :
>
>
> " When writing an error occurs when writing xtrace lines of executed
> script/codes (with set -x)"
>
> So any workaround solution as xtrace itself has been stderr..
I'm really struggling to understand your question. Are you concerned
about the case where "set -x" is in use, but a write to stderr *fails*
because stderr is closed or points to a file on a full disk or something?
If that happens, I don't think *colors* are going to be your main concern.
If you simply want set -x output and stderr from commands not to be
mixed together, use the BASH_XTRACEFD variable.