version 1.111.2.1, 2015/05/13 13:33:55 |
version 1.112, 2014/08/15 13:32:53 |
Line 362 rl_initialize(void) |
|
Line 362 rl_initialize(void) |
|
_el_rl_tstp); |
_el_rl_tstp); |
el_set(e, EL_BIND, "^Z", "rl_tstp", NULL); |
el_set(e, EL_BIND, "^Z", "rl_tstp", NULL); |
|
|
/* |
|
* Set some readline compatible key-bindings. |
|
*/ |
|
el_set(e, EL_BIND, "^R", "em-inc-search-prev", NULL); |
|
|
|
/* |
|
* Allow the use of Home/End keys. |
|
*/ |
|
el_set(e, EL_BIND, "\\e[1~", "ed-move-to-beg", NULL); |
|
el_set(e, EL_BIND, "\\e[4~", "ed-move-to-end", NULL); |
|
el_set(e, EL_BIND, "\\e[7~", "ed-move-to-beg", NULL); |
|
el_set(e, EL_BIND, "\\e[8~", "ed-move-to-end", NULL); |
|
el_set(e, EL_BIND, "\\e[H", "ed-move-to-beg", NULL); |
|
el_set(e, EL_BIND, "\\e[F", "ed-move-to-end", NULL); |
|
|
|
/* |
|
* Allow the use of the Delete/Insert keys. |
|
*/ |
|
el_set(e, EL_BIND, "\\e[3~", "ed-delete-next-char", NULL); |
|
el_set(e, EL_BIND, "\\e[2~", "ed-quoted-insert", NULL); |
|
|
|
/* |
|
* Ctrl-left-arrow and Ctrl-right-arrow for word moving. |
|
*/ |
|
el_set(e, EL_BIND, "\\e[1;5C", "em-next-word", NULL); |
|
el_set(e, EL_BIND, "\\e[1;5D", "ed-prev-word", NULL); |
|
el_set(e, EL_BIND, "\\e[5C", "em-next-word", NULL); |
|
el_set(e, EL_BIND, "\\e[5D", "ed-prev-word", NULL); |
|
el_set(e, EL_BIND, "\\e\\e[C", "em-next-word", NULL); |
|
el_set(e, EL_BIND, "\\e\\e[D", "ed-prev-word", NULL); |
|
|
|
/* read settings from configuration file */ |
/* read settings from configuration file */ |
el_source(e, NULL); |
el_source(e, NULL); |
|
|
Line 665 get_history_event(const char *cmd, int * |
|
Line 634 get_history_event(const char *cmd, int * |
|
* returns 0 if data was not modified, 1 if it was and 2 if the string |
* returns 0 if data was not modified, 1 if it was and 2 if the string |
* should be only printed and not executed; in case of error, |
* should be only printed and not executed; in case of error, |
* returns -1 and *result points to NULL |
* returns -1 and *result points to NULL |
* it's the caller's responsibility to free() the string returned in *result |
* it's callers responsibility to free() string returned in *result |
*/ |
*/ |
static int |
static int |
_history_expand_command(const char *command, size_t offs, size_t cmdlen, |
_history_expand_command(const char *command, size_t offs, size_t cmdlen, |
|
|
for (; str[j]; j++) { |
for (; str[j]; j++) { |
if (str[j] == '\\' && |
if (str[j] == '\\' && |
str[j + 1] == history_expansion_char) { |
str[j + 1] == history_expansion_char) { |
len = strlen(&str[j + 1]) + 1; |
(void)strcpy(&str[j], &str[j + 1]); |
memmove(&str[j], &str[j + 1], len); |
|
continue; |
continue; |
} |
} |
if (!loop_again) { |
if (!loop_again) { |
Line 1726 filename_completion_function(const char |
|
Line 1694 filename_completion_function(const char |
|
* which starts with supplied text |
* which starts with supplied text |
* text contains a partial username preceded by random character |
* text contains a partial username preceded by random character |
* (usually '~'); state resets search from start (??? should we do that anyway) |
* (usually '~'); state resets search from start (??? should we do that anyway) |
* it's the caller's responsibility to free the returned value |
* it's callers responsibility to free returned value |
*/ |
*/ |
char * |
char * |
username_completion_function(const char *text, int state) |
username_completion_function(const char *text, int state) |