diff options
author | Jörg Behrmann <behrmann@physik.fu-berlin.de> | 2022-03-30 22:38:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-30 14:38:39 -0600 |
commit | 4571f4c994cfd9014253a783dced535406da8b11 (patch) | |
tree | 747f43f051f2857dd374d5074352fc746cd5c679 | |
parent | 20000493f36a0c683e2aa08d0de0f077fbaa6589 (diff) | |
download | spack-4571f4c994cfd9014253a783dced535406da8b11.tar.gz spack-4571f4c994cfd9014253a783dced535406da8b11.tar.bz2 spack-4571f4c994cfd9014253a783dced535406da8b11.tar.xz spack-4571f4c994cfd9014253a783dced535406da8b11.zip |
Add completion of locals to spack python (#29702)
-rw-r--r-- | lib/spack/spack/cmd/python.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/spack/spack/cmd/python.py b/lib/spack/spack/cmd/python.py index 901574c12d..ac891dbfd1 100644 --- a/lib/spack/spack/cmd/python.py +++ b/lib/spack/spack/cmd/python.py @@ -118,6 +118,10 @@ def python_interpreter(args): else: # Provides readline support, allowing user to use arrow keys console.push('import readline') + # Provide tabcompletion + console.push('from rlcompleter import Completer') + console.push('readline.set_completer(Completer(locals()).complete)') + console.push('readline.parse_and_bind("tab: complete")') console.interact("Spack version %s\nPython %s, %s %s" % (spack.spack_version, platform.python_version(), |