summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd2.py b/cmd2.py
index 4460ea39..2da007a5 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -2029,6 +2029,9 @@ class Cmd(cmd.Cmd):
self.poutput(' %2d. %s\n' % (idx + 1, text))
while True:
response = sm.input(prompt)
+ hlen = readline.get_current_history_length()
+ if hlen >= 1 and response != '':
+ readline.remove_history_item(hlen - 1)
try:
response = int(response)
result = fulloptions[response - 1][0]