From cca63f2f667ff9dba99d4a1a2b1628253ee9b345 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Mon, 27 Jul 2015 00:00:00 -0500 Subject: [PATCH] top: eliminate 'user' from the inspection view headers Since it's possible that euser name is not being shown or the horizontal position had been scrolled past that USER column, then part of those headers will be blank. So it doesn't make sense to try and show the USER that is associated with a process at all. Thus, this commit simply removes the 'user' provision from both headers. Signed-off-by: Jim Warner --- top/top.c | 15 +++++++-------- top/top_nls.c | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/top/top.c b/top/top.c index ac583d1e..c570061b 100644 --- a/top/top.c +++ b/top/top.c @@ -3041,10 +3041,9 @@ static int insp_view_choice (proc_t *obj) { #define hzAMT 8 #endif #define maxLN (Screen_rows - (Msg_row +1)) - #define makHD(b1,b2,b3) { \ - snprintf(b1, sizeof(b1), "%s", make_num(obj->tid, 5, 1, AUTOX_NO)); \ - snprintf(b2, sizeof(b2), "%s", make_str(obj->cmd, 8, 1, AUTOX_NO)); \ - snprintf(b3, sizeof(b3), "%s", make_str(obj->euser, 8, 1, AUTOX_NO)); } + #define makHD(b1,b2) { \ + snprintf(b1, sizeof(b1), "%d", obj->tid); \ + snprintf(b2, sizeof(b2), "%s", obj->cmd); } #define makFS(dst) { if (Insp_sel->flen < 22) \ snprintf(dst, sizeof(dst), "%s", Insp_sel->fstr); \ else snprintf(dst, sizeof(dst), "%.19s...", Insp_sel->fstr); } @@ -3056,17 +3055,17 @@ signify_that: adj_geometry(); for (;;) { - char pid[6], cmd[9], usr[9]; + char pid[6], cmd[16]; if (curcol < 0) curcol = 0; if (curlin >= Insp_nl) curlin = Insp_nl -1; if (curlin < 0) curlin = 0; makFS(buf) - makHD(pid,cmd,usr) + makHD(pid,cmd) putp(Cap_home); show_special(1, fmtmk(N_unq(YINSP_hdview_fmt) - , pid, cmd, usr, (Insp_sel->fstr[0]) ? buf : " N/A ")); // nls_maybe + , pid, cmd, (Insp_sel->fstr[0]) ? buf : " N/A ")); // nls_maybe insp_show_pgs(curcol, curlin, maxLN); fflush(stdout); /* fflush(stdin) didn't do the trick, so we'll just dip a little deeper @@ -3176,7 +3175,7 @@ signify_that: mkSEL(sels); putp(Cap_home); show_special(1, fmtmk(N_unq(YINSP_hdsels_fmt) - , pid, p->cmd, p->euser, sels)); + , pid, p->cmd, sels)); INSP_MKSL(0, " "); if (Frames_signal) goto signify_that; diff --git a/top/top_nls.c b/top/top_nls.c index a4342e48..7bd1aa32 100644 --- a/top/top_nls.c +++ b/top/top_nls.c @@ -644,12 +644,12 @@ static void build_uniq_nlstab (void) { "%s %s:~3 %9.9s~2total,~3 %9.9s~2free,~3 %9.9s~2used.~3 %9.9s~2avail %s~3\n"); Uniq_nlstab[YINSP_hdsels_fmt] = _("" - "Inspection~2 Pause at: pid ~1%d~6 running ~1%s~6 as user ~1%s~6\n" + "Inspection~2 Pause at: pid ~1%d~6, running ~1%s~6\n" "Use~2: left/right then to ~1select~5 an option; 'q' or to ~1end~5 !\n" "Options~2: ~1%s\n"); Uniq_nlstab[YINSP_hdview_fmt] = _("" - "Inspection~2 View at: ~1%s~3, ~1%s~3, ~1%s~3. Locating: ~1%s~6\n" + "Inspection~2 View at pid: ~1%s~3, running ~1%s~3. Locating: ~1%s~6\n" "Use~2: left/right/up/down/etc to ~1navigate~5 the output; 'L'/'&' to ~1locate~5/~1next~5.\n" "Or~2: to ~1select another~5; 'q' or to ~1end~5 !\n"); } -- 2.40.0