diff options
author | Elliott Hughes <enh@google.com> | 2018-06-11 17:14:29 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-06-12 14:04:14 -0500 |
commit | 1683db07dd8ba6464fa3ee7220948f2681bbef33 (patch) | |
tree | 795e72d63dd66d286560244d4652d19f5ab4c4cc | |
parent | 42ad032a945ff437bc032b0882fb0ce3386bc247 (diff) | |
download | toybox-1683db07dd8ba6464fa3ee7220948f2681bbef33.tar.gz |
top: running processes are shown in bold.
-rw-r--r-- | toys/posix/ps.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c index deab730b..75e8f54b 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -1550,8 +1550,13 @@ static void top_common( recalc = 1; for (i = 0; i<lines && i+topoff<mix.count; i++) { + // Running processes are shown in bold. + int bold = !(toys.optflags&FLAG_b) && mix.tb[i+topoff]->state == 'R'; + if (!(toys.optflags&FLAG_b) && i) xputc('\n'); + if (bold) printf("\033[1m"); show_ps(mix.tb[i+topoff]); + if (bold) printf("\033[m"); } if (TT.top.n && !--TT.top.n) { |