diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2016-02-10 23:08:09 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2016-02-10 23:08:09 +0100 |
commit | 4d80701c7ef5a8d08b97c336463ca575740160ff (patch) | |
tree | 3ef021f091debe23aceb4851e9cdef1a4f81d4db /shellify | |
parent | 92247a9fee6ad97b2697ce0e23763746e2021443 (diff) | |
download | desktop-tools-4d80701c7ef5a8d08b97c336463ca575740160ff.tar.gz desktop-tools-4d80701c7ef5a8d08b97c336463ca575740160ff.tar.xz desktop-tools-4d80701c7ef5a8d08b97c336463ca575740160ff.zip |
shellify: avoid duplicating history entries
Diffstat (limited to 'shellify')
-rwxr-xr-x | shellify | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -11,11 +11,7 @@ readline.parse_and_bind ('TAB: complete') for n in itertools.count (start=1): try: line = input ('\x1b[1m%s %d>\x1b[0m ' % (prefix, n)) - if line == '': - continue - - readline.add_history (line) - os.system (prefix + ' ' + line) + if line != '': os.system (prefix + ' ' + line) except (EOFError, KeyboardInterrupt) as err: print ('') break |