patchThe GNU Bourne-Again SHell - Patches: patch #10157, define tab-completion prefix color...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10157: define tab-completion prefix color in LS_COLORS

Submitter:  Andreas Hrubak <hbandi>
Submitted:  Tue 07 Dec 2021 06:24:38 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  None Open/Closed:  Open

Tue 07 Dec 2021 09:21:46 PM UTC, comment #1: 

Thanks for the patch. There is already a (different) way to do this in the bash devel branch, the result of

https://lists.gnu.org/archive/html/bug-readline/2021-10/msg00000.html


Chet Ramey <chet>
Group administrator
Tue 07 Dec 2021 06:24:38 PM UTC, original submission:  

Hi, please see this patch which adds a new indicator "hl" to LS_COLORS which is used to color common prefixes in tab-completion. previously it was always the socket file type's color. now the user can define it, but the default is kept to be the same as of sockets.


commit e1b94f69cc3ac5268ee47444c507fe9d0d5b051b
Date:   Tue Dec 7 17:57:17 2021 +0100

    support tab-completion prefix color in LS_COLORS, indicator: "hl"

diff --git a/lib/readline/colors.h b/lib/readline/colors.h
index 6561ad9..dc0a888 100644
--- a/lib/readline/colors.h
+++ b/lib/readline/colors.h
@@ -92,7 +92,7 @@ enum indicator_no
     C_FIFO, C_SOCK,
     C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC, C_DOOR, C_SETUID, C_SETGID,
     C_STICKY, C_OTHER_WRITABLE, C_STICKY_OTHER_WRITABLE, C_CAP, C_MULTIHARDLINK,
-    C_CLR_TO_EOL
+    C_CLR_TO_EOL, C_PREFIX
   };


@@ -114,9 +114,6 @@ enum filetype
     arg_directory
   };

-/* Prefix color, currently same as socket */
-#define C_PREFIX        C_SOCK
-
 extern void _rl_put_indicator (const struct bin_str *ind);
 extern void _rl_set_normal_color (void);
 extern bool _rl_print_prefix_color (void);
diff --git a/lib/readline/parse-colors.c b/lib/readline/parse-colors.c
index 05ec9bc..be0f3ff 100644
--- a/lib/readline/parse-colors.c
+++ b/lib/readline/parse-colors.c
@@ -85,6 +85,7 @@ struct bin_str _rl_color_indicator[] =
     { LEN_STR_PAIR ("30;41") },         //  ca: black on red
     { 0, NULL },                        //  mh: disabled by default
     { LEN_STR_PAIR ("\033[K") },        //  cl: clear to end of line
+    { LEN_STR_PAIR ("01;35") },         //  hl: highlight tab-completion prefix
   };

 /* Parse a string as part of the LS_COLORS variable; this may involve
diff --git a/lib/readline/parse-colors.h b/lib/readline/parse-colors.h
index aef86f7..ed5477f 100644
--- a/lib/readline/parse-colors.h
+++ b/lib/readline/parse-colors.h
@@ -37,7 +37,7 @@ static const char *const indicator_name[]=
   {
     "lc", "rc", "ec", "rs", "no", "fi", "di", "ln", "pi", "so",
     "bd", "cd", "mi", "or", "ex", "do", "su", "sg", "st",
-    "ow", "tw", "ca", "mh", "cl", NULL
+    "ow", "tw", "ca", "mh", "cl", "hl", NULL
   };

 /* Buffer for color sequences */


Andreas Hrubak <hbandi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by hbandi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-07 chet StatusNone Wont Do

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code