]> granicus.if.org Git - procps-ng/commitdiff
top: remove those winflags which restricted 'x' toggle
authorJim Warner <james.warner@comcast.net>
Tue, 12 Apr 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sun, 17 Apr 2022 00:43:19 +0000 (10:43 +1000)
On occasion, even as the top author, I wonder why that
'x' toggle has stopped working. Of course, it actually
was working but a locate request ('L') or other filter
('O') operation was active and thus temporarily turned
if off. Such behavior is documented in top's man page.

Well, with this patch that 'x' suppression is no more.

[ the original justification, however, remains true. ]

[ but there's really only one character which causes ]
[ any potential trouble & i'm gonna' keep it secret. ]

[ besides, if a display is corrupted, there's always ]
[ that '=' key which restores things back to normal. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
NEWS
top/top.1
top/top.c
top/top.h

diff --git a/NEWS b/NEWS
index 706621031d4628374470a170ec086ef86070523b..0e705e92629a6bca8ac5bf3158c01e43f06066b4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ procps-ng-NEXT
   * ps: proper aix format string behavior was restored
   * sysctl: print dotted keys again
   * top: fix 'smaps' bug preventing build under clang      issue #235
+  * top: column highlighting allowed under 'L' or 'O'
 
 procps-ng-4.0.0
 ---------------
index ae21893e5902998036d3cd7029a7af05d45ba0e0..814bccd5fffb46a6967a71fb1b037c184aa62134 100644 (file)
--- a/top/top.1
+++ b/top/top.1
@@ -1689,11 +1689,6 @@ The sort field might\fI not\fR be visible because:
     1) there is insufficient\fI Screen Width \fR
     2) the `f' \*(CI turned it \*F
 
-\*(NT Whenever Searching and/or Other Filtering is active in a window,
-column highlighting is temporarily disabled.
-\*(XC notes at the end of topics 5d. SEARCHING and 5e. FILTERING for an
-explanation why.
-
 .TP 7
 \ \ \ \fBy\fR\ \ :\fIRow-Highlight\fR toggle \fR
 Changes highlighting for "running" tasks.
@@ -2188,12 +2183,6 @@ could yet produce a successful `&' search.
 The above \*(CIs are\fB always\fR available in \*(FM but\fB never\fR
 available in \*(AM if the \*(CW's \*(TD has been toggled \*F.
 
-\*(NT Whenever a Search is active in a window, \*(We will turn
-column highlighting \*F to prevent false matches on internal non-display
-escape sequences.
-Such highlighting will be restored when a window's search string is empty.
-\*(XC `x' \*(CI for additional information on sort column highlighting.
-
 .\" ......................................................................
 .SS 5e. FILTERING in a Window
 .\" ----------------------------------------------------------------------
@@ -2363,14 +2352,6 @@ achieve the failed `9999' objective discussed above.
 .fi
 .RS -3
 
-\*(NT Whenever Other Filtering is active in a window, \*(We will turn
-column highlighting \*F to prevent false matches on internal non-display
-escape sequences.
-Such highlighting will be restored when a window is no longer subject
-to filtering.
-\*(XC `x' \*(CI for additional information on sort column highlighting.
-.RE
-
 .\" ----------------------------------------------------------------------
 .SH 6. FILES
 .\" ----------------------------------------------------------------------
index b44aecfc3079c7b0d2af3d42f2fc9ff7935e8b5c..4ae0c5c3b24adc32ff911f21ca8ad8bbe0e069c7 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -3411,9 +3411,6 @@ static void osel_clear (WIN_t *q) {
    }
    q->osel_tot = 0;
    q->osel_1st = NULL;
-#ifndef USE_X_COLHDR
-   OFFw(q, NOHISEL_xxx);
-#endif
 } // end: osel_clear
 
 
@@ -3897,9 +3894,6 @@ static const char *configs_file (FILE *fp, const char *name, float *delay) {
          if (&w->rc.fieldscur[n] != msch(w->rc.fieldscur, w->rc.fieldscur[n], EU_MAXPFLGS))
             return p;
       }
-#ifndef USE_X_COLHDR
-      OFFw(w, NOHIFND_xxx | NOHISEL_xxx);
-#endif
    } // end: for (GROUPSMAX)
 
    // any new addition(s) last, for older rcfiles compatibility...
@@ -4343,10 +4337,6 @@ static void win_reset (WIN_t *q) {
 
          osel_clear(q);
          q->findstr[0] = '\0';
-#ifndef USE_X_COLHDR
-         // NOHISEL_xxx is redundant (already turned off by osel_clear)
-         OFFw(q, NOHIFND_xxx | NOHISEL_xxx);
-#endif
          q->rc.combine_cpus = 0;
 } // end: win_reset
 
@@ -4913,10 +4903,6 @@ static void find_string (int ch) {
       snprintf(Curwin->findstr, FNDBUFSIZ, "%s", str);
       Curwin->findlen = strlen(Curwin->findstr);
       found = 0;
-#ifndef USE_X_COLHDR
-      if (Curwin->findstr[0]) SETw(Curwin, NOHIFND_xxx);
-      else OFFw(Curwin, NOHIFND_xxx);
-#endif
    }
    if (Curwin->findstr[0]) {
       SETw(Curwin, NOPRINT_xxx);
@@ -4999,9 +4985,6 @@ static void other_filters (int ch) {
             show_msg(p);
             return;
          }
-#ifndef USE_X_COLHDR
-         SETw(w, NOHISEL_xxx);
-#endif
          break;
       case kbd_CtrlO:
          if (VIZCHKw(w)) {
@@ -5511,8 +5494,7 @@ static void keys_task (int ch) {
             TOGw(w, Show_HICOLS);
             capsmk(w);
 #else
-            if (ENUviz(w, w->rc.sortindx)
-            && !CHKw(w, NOHIFND_xxx | NOHISEL_xxx)) {
+            if (ENUviz(w, w->rc.sortindx)) {
                TOGw(w, Show_HICOLS);
                if (ENUpos(w, w->rc.sortindx) < w->begpflg) {
                   if (CHKw(w, Show_HICOLS)) w->begpflg += 2;
@@ -6263,7 +6245,7 @@ static const char *task_show (const WIN_t *q, int idx) {
          case EU_XOF:
          case EU_XON:
             cp = NULL;
-            if (!CHKw(q, NOPRINT_xxx | NOHIFND_xxx | NOHISEL_xxx)) {
+            if (!CHKw(q, NOPRINT_xxx)) {
                /* treat running tasks specially - entire row may get highlighted
                   so we needn't turn it on and we MUST NOT turn it off */
                if (!('R' == rSv(EU_STA, s_ch) && CHKw(q, Show_HIROWS)))
index bbed7832d3135706a931eae4648a8a3fdf3ca29a..5b9436f42a60b7d4b10810490fc794d45fa7e9a1 100644 (file)
--- a/top/top.h
+++ b/top/top.h
@@ -269,10 +269,6 @@ typedef          long long SIC_t;
         // these flag(s) have no command as such - they're for internal use
 #define NOPRINT_xxx  0x010000     // build task rows only (not for display)
 #define EQUWINS_xxx  0x000001     // rebalance all wins & tasks (off i,n,u/U)
-#ifndef USE_X_COLHDR
-#define NOHISEL_xxx  0x200000     // restrict Show_HICOLS for osel temporarily
-#define NOHIFND_xxx  0x100000     // restrict Show_HICOLS for find temporarily
-#endif
 
         // Default flags if there's no rcfile to provide user customizations
 #ifdef ORIG_TOPDEFS