aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/expand.cpp
diff options
context:
space:
mode:
authorGravatar Daniel Matz <daniel.matz@gmail.com>2015-11-24 20:27:14 -0600
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-11-27 16:07:16 -0800
commitbf86a92596d6486fe30acb73d4bea6edda9d3df1 (patch)
tree5b6b3f8729b3b6cc08899f8a9ba0621bba39df02 /src/expand.cpp
parent53fc9a4002494e2b1dd7d89f4c62398b64b96059 (diff)
Fix tab completion after '%' character.
Diffstat (limited to 'src/expand.cpp')
-rw-r--r--src/expand.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/expand.cpp b/src/expand.cpp
index 5b46bdfa..107f51d3 100644
--- a/src/expand.cpp
+++ b/src/expand.cpp
@@ -590,8 +590,12 @@ static int find_job(const struct find_job_data_t *info)
const job_t *j;
int found = 0;
- // do the empty param check first, because an empty string passes our 'numeric' check
- if (wcslen(proc)==0)
+ // If we are not doing tab completion, we first check for the single '%'
+ // character, because an empty string will pass the numeric check below.
+ // But if we are doing tab completion, we want all of the job IDs as
+ // completion options, not just the last job backgrounded, so we pass this
+ // first block in favor of the second.
+ if (wcslen(proc)==0 && !(flags & EXPAND_FOR_COMPLETIONS))
{
/*
This is an empty job expansion: '%'