procps watch -c/--color option doesn't work

Bug #1493595 reported by Ariel Faigon on 2015-09-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
procps (Ubuntu)
Undecided
Unassigned

Bug Description

This is a bug report on 'watch' from procps.

Essentially, it doesn't seem like -c/--color (ANSI color sequences support) works.

Here's how to reproduce:

'man watch says':

      -c, --color
              Interpret ANSI color sequences.

This works as expected in bash or dash:

    printf "\033[39;1;43mWhite-On-Red\033[0m\n"

And so is this (additional level of protection from the shell):

    printf '"\033[39;1;43mWhite-On-Red\033[0m\n"'

When running under 'watch', even when the -c/--color is in effect, the colors disappear:

    watch -c printf '"\033[39;1;43mWhite-On-Red\033[0m\n"'

Same issue happens with simpler (one number) ANSI color sequences, e.g.:
    printf '"\033[43mWhite-On-Red\033[0m\n"' # works fine

while:
    watch -c printf '"\033[43mWhite-On-Red\033[0m\n"'

the color disappears.

The same happens when the whole ANSI escape sequence is hidden
from watch (wrapped in a shell script like this:)

    #!/bin/sh
    printf "\033[43mWhite-On-Red\033[0m\n"

call this script 'wor', chmod +x wor and try:

    watch -c ./wor

Again, color is gone.

I'm using procps_3.3.9 on Ubuntu.

   procps 1:3.3.9-1ubuntu2.2

Tried to build from source ('apt-get source procps; cd procps-3.3.9/; make') and the issue is still there.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers