Hacker News new | ask | show | jobs
by mkingston 1461 days ago
Funny viddy came up here today. I created this note about watch in my dotfiles just yesterday (edit: probably not watch's fault! oops..):

> # TODO: this is ugly, doesn't print colours, is there a modern version?

I couldn't get watch to print colours and styles, with the -c switch and forcing colour output on the "inner" command.

Viddy just works and I've immediately created an alias to watch, and substituted all my scripted watch usage. The history feature looks interesting and potentially super-useful, and I'll hopefully remember that exists when I have need for such a thing. Thank you, and keep up the great work!

1 comments

Just curious, would you share the offending command? I’d be interested to take a crack at it.
I had two commands

> watch -c -n 1 -- systemctl --user --state=failed

> watch -c -n 1 -- lfs --color yes -c +inodes_use_percent

I didn't actually look for colour output for systemctl (yeah.. bad debugging, kinda lazy, but it wasn't very important so I didn't give it too much time). I thought I'd try to reproduce for you and thought I should have a quick look at colour output for systemctl, and came up with:

> watch -c -n 1 -- SYSTEMD_COLORS=1 systemctl --user --state=failed

which works well.

The lfs example still does not; I suspect it's probably ignoring the color arg depending on its environment (I wonder if watch changes the env?- not to imply it would be wrong to do so if so).

I feel a bit bad for making it look like this was watch's fault, when it probably isn't. I'll dig into the lfs thing later.