We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Weird completion issue
<!--- Provide a general summary of the issue in the Title above -->
<!--- If you have a question along the lines of "How do I do this Bash command in xonsh"
please first look over the Bash to Xonsh translation guide: https://xon.sh/bash_to_xsh.html
If you don't find an answer there, please do open an issue! -->

## xonfig

<details>

```
$ xonfig
+------------------+-----------------+
| xonsh            | 0.9.12          |
| Python           | 3.7.4           |
| PLY              | 3.11            |
| have readline    | True            |
| prompt toolkit   | 2.0.9           |
| shell type       | prompt_toolkit2 |
| pygments         | 2.4.2           |
| on posix         | True            |
| on linux         | False           |
| on darwin        | True            |
| on windows       | False           |
| on cygwin        | False           |
| on msys2         | False           |
| is superuser     | False           |
| default encoding | utf-8           |
| xonsh encoding   | utf-8           |
| encoding errors  | surrogateescape |
+------------------+-----------------+
```

</details>

## Expected Behavior
<!--- Tell us what should happen -->
Tab completion behind shell command `vim` should work

## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
<!--- If part of your bug report is a traceback, please first enter debug mode before triggering the error
To enter debug mode, set the environment variable `XONSH_DEBUG=1` _before_ starting `xonsh`.
On Linux and OSX, an easy way to to do this is to run `env XONSH_DEBUG=1 xonsh` -->
existing file is not being found by completion (see screenshot).
As you can see in the lower part of the screenshot, the file `pip_packages_to_install.txt` exists in the current folder but isn't found when used behind the shell command `vim` (but does work behind `cat`).
Is this maybe created by interfering completions installed elsewhere? Maybe some vim completions from homebrew?


<img width="822" alt="Screenshot 2019-10-31 14 11 02" src="https://user-images.githubusercontent.com/69774/67982582-99090380-fbe8-11e9-839a-b6fd0536a3ed.png">

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `xonsh/completers/pip.py`
Content:
```
1 """Completers for pip."""
2 # pylint: disable=invalid-name, missing-docstring, unsupported-membership-test
3 # pylint: disable=unused-argument, not-an-iterable
4 import re
5 import subprocess
6 
7 import xonsh.lazyasd as xl
8 
9 
10 @xl.lazyobject
11 def PIP_RE():
12     return re.compile(r"\bx?pip(?:\d|\.)*")
13 
14 
15 @xl.lazyobject
16 def PIP_LIST_RE():
17     return re.compile(r"\bx?pip(?:\d|\.)* (?:uninstall|show)")
18 
19 
20 @xl.lazyobject
21 def ALL_COMMANDS():
22     try:
23         help_text = str(
24             subprocess.check_output(["pip", "--help"], stderr=subprocess.DEVNULL)
25         )
26     except FileNotFoundError:
27         return []
28     commands = re.findall(r"  (\w+)  ", help_text)
29     return [c for c in commands if c not in ["completion", "help"]]
30 
31 
32 def complete_pip(prefix, line, begidx, endidx, ctx):
33     """Completes python's package manager pip"""
34     line_len = len(line.split())
35     if (
36         (line_len > 3)
37         or (line_len > 2 and line.endswith(" "))
38         or (not PIP_RE.search(line))
39     ):
40         return
41     if PIP_LIST_RE.search(line):
42         try:
43             items = subprocess.check_output(["pip", "list"], stderr=subprocess.DEVNULL)
44         except FileNotFoundError:
45             return set()
46         items = items.decode("utf-8").splitlines()
47         return set(i.split()[0] for i in items if i.split()[0].startswith(prefix))
48 
49     if (line_len > 1 and line.endswith(" ")) or line_len > 2:
50         # "pip show " -> no complete (note space)
51         return
52     if prefix not in ALL_COMMANDS:
53         suggestions = [c for c in ALL_COMMANDS if c.startswith(prefix)]
54         if suggestions:
55             return suggestions, len(prefix)
56     return ALL_COMMANDS, len(prefix)
57
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/xonsh/completers/pip.py b/xonsh/completers/pip.py
--- a/xonsh/completers/pip.py
+++ b/xonsh/completers/pip.py
@@ -9,12 +9,12 @@
 
 @xl.lazyobject
 def PIP_RE():
-    return re.compile(r"\bx?pip(?:\d|\.)*")
+    return re.compile(r"\bx?pip(?:\d|\.)*\b")
 
 
 @xl.lazyobject
 def PIP_LIST_RE():
-    return re.compile(r"\bx?pip(?:\d|\.)* (?:uninstall|show)")
+    return re.compile(r"\bx?pip(?:\d|\.)*\b (?:uninstall|show)")
 
 
 @xl.lazyobject

{"golden_diff": "diff --git a/xonsh/completers/pip.py b/xonsh/completers/pip.py\n--- a/xonsh/completers/pip.py\n+++ b/xonsh/completers/pip.py\n@@ -9,12 +9,12 @@\n \n @xl.lazyobject\n def PIP_RE():\n-    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\")\n+    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\\b\")\n \n \n @xl.lazyobject\n def PIP_LIST_RE():\n-    return re.compile(r\"\\bx?pip(?:\\d|\\.)* (?:uninstall|show)\")\n+    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\\b (?:uninstall|show)\")\n \n \n @xl.lazyobject\n", "issue": "Weird completion issue\n<!--- Provide a general summary of the issue in the Title above -->\r\n<!--- If you have a question along the lines of \"How do I do this Bash command in xonsh\"\r\nplease first look over the Bash to Xonsh translation guide: https://xon.sh/bash_to_xsh.html\r\nIf you don't find an answer there, please do open an issue! -->\r\n\r\n## xonfig\r\n\r\n<details>\r\n\r\n```\r\n$ xonfig\r\n+------------------+-----------------+\r\n| xonsh            | 0.9.12          |\r\n| Python           | 3.7.4           |\r\n| PLY              | 3.11            |\r\n| have readline    | True            |\r\n| prompt toolkit   | 2.0.9           |\r\n| shell type       | prompt_toolkit2 |\r\n| pygments         | 2.4.2           |\r\n| on posix         | True            |\r\n| on linux         | False           |\r\n| on darwin        | True            |\r\n| on windows       | False           |\r\n| on cygwin        | False           |\r\n| on msys2         | False           |\r\n| is superuser     | False           |\r\n| default encoding | utf-8           |\r\n| xonsh encoding   | utf-8           |\r\n| encoding errors  | surrogateescape |\r\n+------------------+-----------------+\r\n```\r\n\r\n</details>\r\n\r\n## Expected Behavior\r\n<!--- Tell us what should happen -->\r\nTab completion behind shell command `vim` should work\r\n\r\n## Current Behavior\r\n<!--- Tell us what happens instead of the expected behavior -->\r\n<!--- If part of your bug report is a traceback, please first enter debug mode before triggering the error\r\nTo enter debug mode, set the environment variable `XONSH_DEBUG=1` _before_ starting `xonsh`.\r\nOn Linux and OSX, an easy way to to do this is to run `env XONSH_DEBUG=1 xonsh` -->\r\nexisting file is not being found by completion (see screenshot).\r\nAs you can see in the lower part of the screenshot, the file `pip_packages_to_install.txt` exists in the current folder but isn't found when used behind the shell command `vim` (but does work behind `cat`).\r\nIs this maybe created by interfering completions installed elsewhere? Maybe some vim completions from homebrew?\r\n\r\n\r\n<img width=\"822\" alt=\"Screenshot 2019-10-31 14 11 02\" src=\"https://user-images.githubusercontent.com/69774/67982582-99090380-fbe8-11e9-839a-b6fd0536a3ed.png\">\n", "before_files": [{"content": "\"\"\"Completers for pip.\"\"\"\n# pylint: disable=invalid-name, missing-docstring, unsupported-membership-test\n# pylint: disable=unused-argument, not-an-iterable\nimport re\nimport subprocess\n\nimport xonsh.lazyasd as xl\n\n\n@xl.lazyobject\ndef PIP_RE():\n    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\")\n\n\n@xl.lazyobject\ndef PIP_LIST_RE():\n    return re.compile(r\"\\bx?pip(?:\\d|\\.)* (?:uninstall|show)\")\n\n\n@xl.lazyobject\ndef ALL_COMMANDS():\n    try:\n        help_text = str(\n            subprocess.check_output([\"pip\", \"--help\"], stderr=subprocess.DEVNULL)\n        )\n    except FileNotFoundError:\n        return []\n    commands = re.findall(r\"  (\\w+)  \", help_text)\n    return [c for c in commands if c not in [\"completion\", \"help\"]]\n\n\ndef complete_pip(prefix, line, begidx, endidx, ctx):\n    \"\"\"Completes python's package manager pip\"\"\"\n    line_len = len(line.split())\n    if (\n        (line_len > 3)\n        or (line_len > 2 and line.endswith(\" \"))\n        or (not PIP_RE.search(line))\n    ):\n        return\n    if PIP_LIST_RE.search(line):\n        try:\n            items = subprocess.check_output([\"pip\", \"list\"], stderr=subprocess.DEVNULL)\n        except FileNotFoundError:\n            return set()\n        items = items.decode(\"utf-8\").splitlines()\n        return set(i.split()[0] for i in items if i.split()[0].startswith(prefix))\n\n    if (line_len > 1 and line.endswith(\" \")) or line_len > 2:\n        # \"pip show \" -> no complete (note space)\n        return\n    if prefix not in ALL_COMMANDS:\n        suggestions = [c for c in ALL_COMMANDS if c.startswith(prefix)]\n        if suggestions:\n            return suggestions, len(prefix)\n    return ALL_COMMANDS, len(prefix)\n", "path": "xonsh/completers/pip.py"}], "after_files": [{"content": "\"\"\"Completers for pip.\"\"\"\n# pylint: disable=invalid-name, missing-docstring, unsupported-membership-test\n# pylint: disable=unused-argument, not-an-iterable\nimport re\nimport subprocess\n\nimport xonsh.lazyasd as xl\n\n\n@xl.lazyobject\ndef PIP_RE():\n    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\\b\")\n\n\n@xl.lazyobject\ndef PIP_LIST_RE():\n    return re.compile(r\"\\bx?pip(?:\\d|\\.)*\\b (?:uninstall|show)\")\n\n\n@xl.lazyobject\ndef ALL_COMMANDS():\n    try:\n        help_text = str(\n            subprocess.check_output([\"pip\", \"--help\"], stderr=subprocess.DEVNULL)\n        )\n    except FileNotFoundError:\n        return []\n    commands = re.findall(r\"  (\\w+)  \", help_text)\n    return [c for c in commands if c not in [\"completion\", \"help\"]]\n\n\ndef complete_pip(prefix, line, begidx, endidx, ctx):\n    \"\"\"Completes python's package manager pip\"\"\"\n    line_len = len(line.split())\n    if (\n        (line_len > 3)\n        or (line_len > 2 and line.endswith(\" \"))\n        or (not PIP_RE.search(line))\n    ):\n        return\n    if PIP_LIST_RE.search(line):\n        try:\n            items = subprocess.check_output([\"pip\", \"list\"], stderr=subprocess.DEVNULL)\n        except FileNotFoundError:\n            return set()\n        items = items.decode(\"utf-8\").splitlines()\n        return set(i.split()[0] for i in items if i.split()[0].startswith(prefix))\n\n    if (line_len > 1 and line.endswith(\" \")) or line_len > 2:\n        # \"pip show \" -> no complete (note space)\n        return\n    if prefix not in ALL_COMMANDS:\n        suggestions = [c for c in ALL_COMMANDS if c.startswith(prefix)]\n        if suggestions:\n            return suggestions, len(prefix)\n    return ALL_COMMANDS, len(prefix)\n", "path": "xonsh/completers/pip.py"}]}