aboutsummaryrefslogtreecommitdiffhomepage
path: root/expand.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-09-11 18:50:14 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-09-11 18:50:14 -0700
commit307a4ae9e854a8697dbde6861839d1c7a0615ef6 (patch)
treebecb4cbb81e5ffc7791c2f979bececfd58b6baf1 /expand.cpp
parent46452e7634b658f2a5f704890ae9d77d932d4610 (diff)
Don't do completions or autosuggestions for commands with wildcards.
Diffstat (limited to 'expand.cpp')
-rw-r--r--expand.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/expand.cpp b/expand.cpp
index 9dfe5026..4408a3e4 100644
--- a/expand.cpp
+++ b/expand.cpp
@@ -1729,9 +1729,15 @@ int expand_string(const wcstring &input, std::vector<completion_t> &output, expa
remove_internal_separator(next_str, (EXPAND_SKIP_WILDCARDS & flags) ? true : false);
const wchar_t *next = next_str.c_str();
-
- if (((flags & ACCEPT_INCOMPLETE) && (!(flags & EXPAND_SKIP_WILDCARDS))) ||
- wildcard_has(next, 1))
+
+ const bool has_wildcard = wildcard_has(next, 1);
+
+ if (has_wildcard && (flags & EXECUTABLES_ONLY))
+ {
+ // Don't do wildcard expansion for executables. See #785. So do nothing here.
+ }
+ else if (((flags & ACCEPT_INCOMPLETE) && (!(flags & EXPAND_SKIP_WILDCARDS))) ||
+ has_wildcard)
{
const wchar_t *start, *rest;