diff options
author | Todd Leonhardt <tleonhardt@gmail.com> | 2017-06-09 15:37:41 -0400 |
---|---|---|
committer | Todd Leonhardt <tleonhardt@gmail.com> | 2017-06-09 15:37:41 -0400 |
commit | c9854771a2f280a23cb9176f820efabb69c49398 (patch) | |
tree | c2bf0ae9fad1b4d111ffbc0a0c982caf75731c84 /cmd2.py | |
parent | eb3d29538e3f898cb69e1f2964a7f84a3c0391d4 (diff) | |
download | cmd2-git-c9854771a2f280a23cb9176f820efabb69c49398.tar.gz |
Manually set readline delimiters to not include a dash ("-")
This is because file paths which had a "-" in them were not being completed with tab completion of local paths.
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1090,7 +1090,10 @@ class Cmd(cmd.Cmd): if self.use_rawinput and self.completekey: try: self.old_completer = readline.get_completer() + self.old_delims = readline.get_completer_delims() readline.set_completer(self.complete) + # Don't treat "-" as a readline delimiter since it is commonly used in filesystem paths + readline.set_completer_delims(self.old_delims.replace('-', '')) readline.parse_and_bind(self.completekey + ": complete") except NameError: pass @@ -1109,6 +1112,7 @@ class Cmd(cmd.Cmd): if self.use_rawinput and self.completekey: try: readline.set_completer(self.old_completer) + readline.set_completer_delims(self.old_delims) except NameError: pass return stop |