diff options
author | Alberto Sartori <alberto.sartori.as@gmail.com> | 2018-03-15 14:26:34 +0100 |
---|---|---|
committer | Alberto Sartori <alberto.sartori.as@gmail.com> | 2018-03-15 17:56:07 +0100 |
commit | 87b0a61b1e668d5b18d93b3ec7a528a645edd2a1 (patch) | |
tree | 8dbd1cc93dd270a99396131c014f0674bfc50e1d /cmd2.py | |
parent | 543d2ae40f14f3cfd556cb482da70b26dc689f59 (diff) | |
download | cmd2-git-87b0a61b1e668d5b18d93b3ec7a528a645edd2a1.tar.gz |
remove history line in select when user insert choice
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2046,6 +2046,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] |