client: Add readline support to empire client
Readline provides fancy command line editing such as <Arrow Up> for previous commands and CTRL+A to jump to the beginning of the line. This patch does not add any completion on <tab> key, a TODO, if you will. A new command line flag, -H, turns on saving the history to disk. This may have security implications on shared computers, as all commands are saved as-is. Thus "change re 1234" would be logged directly to the file. Signed-off-by: Martin Haukeli <martin.haukeli@gmail.com> Rebase on top of preparatory work, fix a few bugs, and tidy up: * Update the standalone client build, too. * Fix the Windows build. * Keep command line options sorted case-insensitively. * Error out when $HOME is unset and getpwuid() fails, just like we do for $LOGNAME. * Give @input_from_rl, @has_rl_input static linkage. * @has_rl_input is a flag, not a counter, set and test it accordingly. * Save all input in history, not just commands. Martin's attempt to recognize commands works only as long as the server sends prompts faster than the user sends input. Drop that part, and update commit message accordingly. * Fix recv_input() not to truncate value of strlen() to int, and to use memmove() for updating @input_from_rl in place. * Clean up whitespace in a few places. * Tweak commit message. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
594cd20f76
commit
f1fc0df03d
9 changed files with 256 additions and 14 deletions
2
Make.mk
2
Make.mk
|
@ -432,5 +432,5 @@ $(srcdir)/src/client/config.h.in: src/client/configure.ac src/client/aclocal.m4
|
|||
cd $(dir $@) && autoheader
|
||||
touch $@
|
||||
|
||||
$(srcdir)/src/client/aclocal.m4: m4/ax_lib_socket_nsl.m4 m4/my_terminfo.m4 m4/my_windows_api.m4
|
||||
$(srcdir)/src/client/aclocal.m4: m4/ax_lib_readline.m4 m4/ax_lib_socket_nsl.m4 m4/my_terminfo.m4 m4/my_windows_api.m4
|
||||
cat $^ >$@
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue