aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-06-11 17:14:29 -0700
committerRob Landley <rob@landley.net>2018-06-12 14:04:14 -0500
commit1683db07dd8ba6464fa3ee7220948f2681bbef33 (patch)
tree795e72d63dd66d286560244d4652d19f5ab4c4cc /toys
parent42ad032a945ff437bc032b0882fb0ce3386bc247 (diff)
downloadtoybox-1683db07dd8ba6464fa3ee7220948f2681bbef33.tar.gz
top: running processes are shown in bold.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/ps.c5
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) {