aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-02-10 23:08:09 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-02-10 23:08:09 +0100
commit4d80701c7ef5a8d08b97c336463ca575740160ff (patch)
tree3ef021f091debe23aceb4851e9cdef1a4f81d4db
parent92247a9fee6ad97b2697ce0e23763746e2021443 (diff)
downloaddesktop-tools-4d80701c7ef5a8d08b97c336463ca575740160ff.tar.gz
desktop-tools-4d80701c7ef5a8d08b97c336463ca575740160ff.tar.xz
desktop-tools-4d80701c7ef5a8d08b97c336463ca575740160ff.zip
shellify: avoid duplicating history entries
-rwxr-xr-xshellify6
1 files changed, 1 insertions, 5 deletions
diff --git a/shellify b/shellify
index 430178d..42e8505 100755
--- a/shellify
+++ b/shellify
@@ -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