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 <james.warner@comcast.net>
This commit is contained in:
parent
63e828fe88
commit
cca63f2f66
15
top/top.c
15
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;
|
||||
|
@ -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 <Enter> to ~1select~5 an option; 'q' or <Esc> 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: <Enter> to ~1select another~5; 'q' or <Esc> to ~1end~5 !\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user