diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-03-15 13:14:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-15 13:14:16 -0400 |
commit | c357f9b04b96ca31d26003e7e71e4f95a95a02e3 (patch) | |
tree | 8dbd1cc93dd270a99396131c014f0674bfc50e1d | |
parent | 543d2ae40f14f3cfd556cb482da70b26dc689f59 (diff) | |
parent | 87b0a61b1e668d5b18d93b3ec7a528a645edd2a1 (diff) | |
download | cmd2-git-c357f9b04b96ca31d26003e7e71e4f95a95a02e3.tar.gz |
Merge pull request #311 from python-cmd2/fix/useless-history-line-in-select
remove history line in select when user insert choice
-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] |