2018-06-13 13:41:42 +02:00
|
|
|
Special for screen and its new TERM setting like TERM=screen.xterm-256color
|
2019-08-16 12:08:37 +02:00
|
|
|
Map all "screen(-xxx)?.yyy(-zzz)?" to "screen" as well as map "konsole(-xxx)?"
|
|
|
|
and "gnome(-xxx)?" to "xterm".
|
|
|
|
|
|
|
|
This helps to get /etc/inputrc work for most users.
|
2018-06-13 13:41:42 +02:00
|
|
|
|
|
|
|
---
|
2019-08-16 12:08:37 +02:00
|
|
|
lib/readline/bind.c | 19 +++++++++++++++++--
|
|
|
|
1 file changed, 17 insertions(+), 2 deletions(-)
|
2018-06-13 13:41:42 +02:00
|
|
|
|
|
|
|
--- lib/readline/bind.c
|
2019-08-16 12:08:37 +02:00
|
|
|
+++ lib/readline/bind.c 2019-08-16 08:26:42.327029248 +0000
|
2021-01-11 12:44:48 +01:00
|
|
|
@@ -1228,19 +1228,34 @@ parser_if (char *args)
|
2019-08-16 12:08:37 +02:00
|
|
|
word in ARGS is the same as the value stored in rl_readline_name. */
|
|
|
|
if (rl_terminal_name && _rl_strnicmp (args, "term=", 5) == 0)
|
|
|
|
{
|
|
|
|
- char *tem, *tname;
|
|
|
|
+ char *tem, *tname, *talias;
|
|
|
|
|
|
|
|
- /* Terminals like "aaa-60" are equivalent to "aaa". */
|
|
|
|
tname = savestring (rl_terminal_name);
|
|
|
|
+ /* Various terminal types of screen are equivalent to "screen" */
|
|
|
|
+ if (_rl_strnicmp (rl_terminal_name, "screen", 6) == 0)
|
2018-06-13 13:41:42 +02:00
|
|
|
+ {
|
2019-08-16 12:08:37 +02:00
|
|
|
+ tem = strchr (tname, '.');
|
|
|
|
+ if (tem)
|
|
|
|
+ *tem = '\0';
|
2018-06-13 13:41:42 +02:00
|
|
|
+ }
|
2019-08-16 12:08:37 +02:00
|
|
|
+ /* Terminals like "aaa-60" are equivalent to "aaa". */
|
|
|
|
tem = strchr (tname, '-');
|
|
|
|
if (tem)
|
|
|
|
*tem = '\0';
|
|
|
|
|
|
|
|
+ /* Map terminal types "konsole" and "gnome" to "xterm" nowadays */
|
|
|
|
+ talias = tname;
|
|
|
|
+ if (_rl_stricmp("konsole", tname) == 0)
|
|
|
|
+ talias = "xterm";
|
|
|
|
+ if (_rl_stricmp("gnome", tname) == 0)
|
|
|
|
+ talias = "xterm";
|
2018-06-13 13:41:42 +02:00
|
|
|
+
|
2019-08-16 12:08:37 +02:00
|
|
|
/* Test the `long' and `short' forms of the terminal name so that
|
|
|
|
if someone has a `sun-cmd' and does not want to have bindings
|
|
|
|
that will be executed if the terminal is a `sun', they can put
|
|
|
|
`$if term=sun-cmd' into their .inputrc. */
|
|
|
|
_rl_parsing_conditionalized_out = _rl_stricmp (args + 5, tname) &&
|
|
|
|
+ _rl_stricmp (args + 5, talias) &&
|
|
|
|
_rl_stricmp (args + 5, rl_terminal_name);
|
2018-06-13 13:41:42 +02:00
|
|
|
xfree (tname);
|
|
|
|
}
|