Comment 4 for bug 721982

Revision history for this message
James Cuzella (trinitronx) wrote :

I stumbled upon this bug when using a color PS4 prompt to trace bash scripts. Usually it would display fine, but I noticed some strange behavior once the shell level increased enough.

Bash repeats the first character of the PS4 prompt to indicate the shell level for scripts that call other scripts (or subshells). Once the shell level increases enough, the characters at the end of the prompt are truncated.

This causes display problems, especially if the "color off" ANSI code is chopped off the end.

Many thanks for finding this bug!
It was driving me nuts until I used the 'script' command to record my terminal's raw output and found that the prompt was being truncated.

With this patch, I still see that rl_message still seems to use a size of 128 and truncates if my system does not have vsnprintf. I compiled bash-static and tested a long PS4 with color codes, and it still seems to truncate for me.

How can I check that my system has vsnprintf?