Consider this simple example (which displays in red):
echo -e "\033[31mHello World\033[0m"
It displays on the terminal correctly in red. Now consider:
watch echo -e "\033[31mHello World\033[0m"
It does not display the color.
Note: I am aware that it is easy to write a loop that mimics the basic behavior by clearing and rerunning. However, the clear operation causes the screen to flash, which does not happen under watch
EDIT: Originally this question specified escape sequences rather than vt100 sequences, but that is not really what I am after, and was solved with single quotes.
Edit:
More recent versions of
watchsupport color. You will need to use an extra level of quoting to preserve the quotes and escapes in the particular situation of the example in the question:From
man watch:Previously:
From
man watch:But they don’t get interpreted, so I don’t think there’s any way.