----
doc/{bash.1,bashref.texi}
- add link to git master tar file as a place to get the current version
+
+ 4/14
+ ----
+bashline.c
+ - attempt_shell_completion: use -1 as a sentinel value for
+ in_command_position indicating that we cannot be in a command position
+ (e.g., because we're the target of a redirection) and should not
+ check for a programmable command completion or tell the programmable
+ completion code to use command completion. Report and fix from
+ Marc Aurèle La France <tsi@tuyoix.net>
+
+ 4/16
+ ----
+builtins/bind.def
+ - bind_builtin: reverse sense of strvec_search return value when
+ deciding whether or not to remove a unix-command binding from the
+ cmd keymap. Bug report by Dale Sedivec <dale@codefu.org>
+
+lib/readline/doc/rltech.texi
+ - RL_PROMPT_{START,END}_IGNORE: document current values of \001 and
+ \002. Report from Mingye Wang <arthur200126@gmail.com>
in_command_position++;
if (check_redir (ti) == 1)
- in_command_position = 0;
+ in_command_position = -1; /* sentinel that we're not the first word on the line */
}
else
{
assignments. */
}
- if (in_command_position && invalid_completion (text, ti))
+ if (in_command_position > 0 && invalid_completion (text, ti))
{
rl_attempted_completion_over = 1;
return ((char **)NULL);
/* Check that we haven't incorrectly flagged a closed command substitution
as indicating we're in a command position. */
- if (in_command_position && ti >= 0 && rl_line_buffer[ti] == '`' &&
+ if (in_command_position > 0 && ti >= 0 && rl_line_buffer[ti] == '`' &&
*text != '`' && unclosed_pair (rl_line_buffer, end, "`") == 0)
- in_command_position = 0;
+ in_command_position = -1; /* not following a command separator */
/* Special handling for command substitution. If *TEXT is a backquote,
it can be the start or end of an old-style command substitution, or
succeed. Don't bother if readline found a single quote and we are
completing on the substring. */
if (*text == '`' && rl_completion_quote_character != '\'' &&
- (in_command_position || (unclosed_pair (rl_line_buffer, start, "`") &&
- unclosed_pair (rl_line_buffer, end, "`"))))
+ (in_command_position > 0 || (unclosed_pair (rl_line_buffer, start, "`") &&
+ unclosed_pair (rl_line_buffer, end, "`"))))
matches = rl_completion_matches (text, command_subst_completion_function);
#if defined (PROGRAMMABLE_COMPLETION)
have_progcomps = prog_completion_enabled && (progcomp_size () > 0);
iw_compspec = progcomp_search (INITIALWORD);
if (matches == 0 &&
- (in_command_position == 0 || text[0] == '\0' || (in_command_position && iw_compspec)) &&
+ (in_command_position == 0 || text[0] == '\0' || (in_command_position > 0 && iw_compspec)) &&
current_prompt_string == ps1_prompt)
{
int s, e, s1, e1, os, foundcs;
if (matches == 0)
{
dflags = 0;
- if (in_command_position)
+ if (in_command_position > 0)
dflags |= DEFCOMP_CMDPOS;
matches = bash_default_completion (text, start, end, qc, dflags);
}
Applications may indicate that the prompt contains characters that take
up no physical screen space when displayed by bracketing a sequence of
such characters with the special markers @code{RL_PROMPT_START_IGNORE}
-and @code{RL_PROMPT_END_IGNORE} (declared in @file{readline.h}). This may
-be used to embed terminal-specific escape sequences in prompts.
+and @code{RL_PROMPT_END_IGNORE} (declared in @file{readline.h} as
+@samp{\001} and @samp{\002}, respectively).
+This may be used to embed terminal-specific escape sequences in prompts.
@end deftypefun
@deftypefun int rl_set_prompt (const char *prompt)