I have a debug trap that runs every time I enter a command in bash that sets the window title to indicate what command is running. I'm leaving out all the configuration details and boil it down to:
This works incredibly well, with only one snag: if the bash shell is running in an environment that does not support this feature, the GENERATED_WINDOW_TITLE is printed on the screen with each prompt. This happens any time I'm running bash from a non-X terminal.
How can bash tell if this escape sequence is supported?