summaryrefslogtreecommitdiff
path: root/cmd2/rl_utils.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-05-23 11:16:27 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-05-23 11:16:27 -0400
commit24aa66f1101d8ede2bbd8ae3a79d20cb398b1eec (patch)
treef8e0fb2d41f31dc3242bbdb56980b5158296f04e /cmd2/rl_utils.py
parent4ce81a71de2aeb184f64d360d1774b8698d16ba3 (diff)
downloadcmd2-git-24aa66f1101d8ede2bbd8ae3a79d20cb398b1eec.tar.gz
Added tab completion of Python identifiers when running the Python console
Diffstat (limited to 'cmd2/rl_utils.py')
-rw-r--r--cmd2/rl_utils.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd2/rl_utils.py b/cmd2/rl_utils.py
index 5d278a0b..55ca4a12 100644
--- a/cmd2/rl_utils.py
+++ b/cmd2/rl_utils.py
@@ -33,8 +33,17 @@ rl_type = RlType.NONE
if 'pyreadline' in sys.modules:
rl_type = RlType.PYREADLINE
- # pyreadline is incomplete in terms of the Python readline API
- # Add the missing functions we need
+ ############################################################################################################
+ # pyreadline is incomplete in terms of the Python readline API. Add the missing functions we need.
+ ############################################################################################################
+ # readline.redisplay()
+ try:
+ getattr(readline, 'redisplay')
+ except AttributeError:
+ # noinspection PyProtectedMember
+ readline.redisplay = readline.rl.mode._update_line
+
+ # readline.remove_history_item()
try:
getattr(readline, 'remove_history_item')
except AttributeError: