On Wed, Apr 20, 2022 at 4:55 PM Bart Schaefer wrote: > > You could play around with variations on this hack: This was actually kind of fun, except for the part where I was baffled for an hour by sysread apparently being buggy. I installed https://gitlab.com/saalen/highlight Aside: Anyone want to supply a zsh language file and completion script for that? The "sh" language file is OK but not perfect for zsh. The attached file creates a function "hlxt" plus a precmd helper which arrange to write xtrace output through "highlight" and play it back just before printing the next prompt. It uses a coproc for this. That means it won't work in a shell script, which is why I've named the file "v1" while I play with it some more. To use it, source the file and type "hlxt on". To stop, "hlxt off". Important caveats: Capturing the trace output has to redirect stderr, which means error output from the commands you run is also passed through it. To avoid that, add 2>&$stderr to the command line. This can only handle as much trace output as will fit in the OS pipe buffers on the input and output of the coprocess. More than that will cause it to hang because the output buffer is not consumed until precmd runs. Solving for the script problem might solve this too.