taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

rc._forcecolor=on does not work with `watch`

Open bergercookie opened this issue 2 years ago • 4 comments

Force-enabling the use of colors on the terminal works fine when piping the task output to less -R like in the following case:

task  rc._forcecolor=on   | less -R

However, wrapping the same command with watch --color doesn't enable the coloring of the tasks:

watch  --color task  rc._forcecolor=on

On the other hand combining ls --color with watch --color seems to work fine:

watch  --color ls --color

Output of task diag

task 2.6.2
   Platform: Linux

Compiler
    Version: 9.4.0
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++17

Build Features
     Commit: 0a558ef7c
      CMake: 3.23.0-rc2
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.6.13
 Build type:

Configuration
       File: /home/berger/.taskrc (found), 3971 bytes, mode 100664
       Data: /home/berger/.task (found), dir, mode 40775
    Locking: Enabled
         GC: Enabled
    $EDITOR: nvim
     Server:
         CA: not found
Certificate: not found
        Key: not found
      Trust: strict
    Ciphers: NORMAL
      Creds:

Hooks
     System: Enabled
   Location: /home/berger/.task/hooks
             (-none-)

Tests
   Terminal: 161x41
       Dups: Scanned 10481 tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned 10481 tasks for broken references:
             No broken references found

bergercookie avatar May 28 '22 12:05 bergercookie

Might be terminal dependent? I can't reproduce this with xfce-terminal: image

tbabej avatar May 28 '22 15:05 tbabej

For the record, I'm running watch with version "watch from procps-ng 3.3.17"

tbabej avatar May 28 '22 15:05 tbabej

I can repro this in gnome-terminal and kitty , xfce-terminal and gnome-terminal so I'm confident this is an issue with the procps version. I'm using procps 2:3.3.16-1ubuntu2.3 instead of procps-ng.

bergercookie avatar May 29 '22 08:05 bergercookie

I'm using watch from procps-2:3.3.17-6ubuntu2 with urxvt and color is working fine with _forcecolor

smemsh avatar Jun 05 '22 13:06 smemsh

Have the same problem - task under watch is color-less, instead of other utils.

my env:

  • watch from procps-ng 3.3.17
  • task version - 2.6.1
  • termital:
    • gnome-terminal 3.44.0
    • kitty 0.21.2
  • dist - Ubuntu 22.04.3

GlebPoljakov avatar Oct 26 '23 12:10 GlebPoljakov

thanks to my colleague - we found lost color.

watch strips not-ANSI colors. change taskwarrior color scheme to simple 16-colors returns colors in task-list in watch.

GlebPoljakov avatar Oct 26 '23 12:10 GlebPoljakov

Glad you solved it!

djmitche avatar Oct 26 '23 16:10 djmitche