From 4d80701c7ef5a8d08b97c336463ca575740160ff Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Wed, 10 Feb 2016 23:08:09 +0100
Subject: shellify: avoid duplicating history entries
---
shellify | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
(limited to 'shellify')
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
--
cgit v1.2.3-70-g09d2