shellify: avoid duplicating history entries
This commit is contained in:
parent
92247a9fee
commit
4d80701c7e
6
shellify
6
shellify
|
@ -11,11 +11,7 @@ readline.parse_and_bind ('TAB: complete')
|
||||||
for n in itertools.count (start=1):
|
for n in itertools.count (start=1):
|
||||||
try:
|
try:
|
||||||
line = input ('\x1b[1m%s %d>\x1b[0m ' % (prefix, n))
|
line = input ('\x1b[1m%s %d>\x1b[0m ' % (prefix, n))
|
||||||
if line == '':
|
if line != '': os.system (prefix + ' ' + line)
|
||||||
continue
|
|
||||||
|
|
||||||
readline.add_history (line)
|
|
||||||
os.system (prefix + ' ' + line)
|
|
||||||
except (EOFError, KeyboardInterrupt) as err:
|
except (EOFError, KeyboardInterrupt) as err:
|
||||||
print ('')
|
print ('')
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue