From 26c95349fc2f4f7e826aacc213fb0ea56b1ece8f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Sat, 22 Feb 2014 12:24:22 -0500 Subject: [PATCH] Do not complete 'cd' to non-path elements --- bin/confetty | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/confetty b/bin/confetty index c68a0a6f..8bc3b56b 100755 --- a/bin/confetty +++ b/bin/confetty @@ -105,6 +105,7 @@ def rcompleter(text, state): else: foundcount += 1 return None + cmd = args[0] if candidates is None: candidates = [] targpath = fullpath_target(args[-1]) @@ -117,6 +118,8 @@ def rcompleter(text, state): candidates.append(item["href"]) foundcount = 0 for elem in candidates: + if cmd == 'cd' and elem[-1] != '/': + continue if elem.startswith(text): if foundcount == state: return elem