From 6a0f9d9874276d25ec9d53b77bcbba994ec0c51a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 13 Dec 2015 17:39:22 +0100 Subject: [PATCH] client: Support $if Empire in .inputrc Set the application name to "Empire" to support Empire-specific customization of readline. Use in .inputrc looks like this: $if Empire set bell-style audible set history-size 500 else set bell-style visible $endif Signed-off-by: Markus Armbruster --- man/empire.6 | 3 ++- src/client/play.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/man/empire.6 b/man/empire.6 index a1eff5d9..764811e6 100644 --- a/man/empire.6 +++ b/man/empire.6 @@ -91,7 +91,8 @@ The filename for the \fBreadline\fP startup file, overriding the default of \fI~/.inputrc\fP (see \fBREADLINE\fP below). .SH READLINE When compiled with the GNU \fBreadline\fP library, the client supports -fancy line editing and persistent history. See the readline +fancy line editing and persistent history. Its application name for +application-specific settings is \fBEmpire\fP. See the readline documentation for details. .SH "SEE ALSO" \fIemp_server\fR(6), \fIreadline\fR(3). diff --git a/src/client/play.c b/src/client/play.c index bd00768b..5349f323 100644 --- a/src/client/play.c +++ b/src/client/play.c @@ -567,6 +567,7 @@ play(int sock, char *history_file) if (isatty(0)) { use_readline = 1; rl_already_prompted = 1; + rl_readline_name = "Empire"; if (history_file) read_history(history_file); rl_bind_key('\t', rl_insert); /* Disable tab completion */