Public bug reported:

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.

** Affects: procps (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: procps watch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1493595

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/procps/+bug/1493595/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to