X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=blobdiff_plain;f=rainbowstream%2Finteractive.py;h=76755e8c21adf85dfc2fddb4835f1889021081b1;hp=546d776f554947dfcace97a8b7fc24e78ab84ba5;hb=0e6d22d6fb2c54f5eb37028da1414279e2d1a625;hpb=c3bab4ef2c05950ac280571d9b3575beb5203b31 diff --git a/rainbowstream/interactive.py b/rainbowstream/interactive.py index 546d776..76755e8 100644 --- a/rainbowstream/interactive.py +++ b/rainbowstream/interactive.py @@ -39,8 +39,8 @@ class RainbowCompleter(object): candidates = self.options[first] if being_completed: - self.current_candidates = [ w for w in candidates - if w.startswith(being_completed) ] + self.current_candidates = [w for w in candidates + if w.startswith(being_completed)] else: self.current_candidates = candidates @@ -68,15 +68,20 @@ def read_history(): """ Read history file """ - if os.path.isfile(c['HISTORY_FILENAME']): + try: readline.read_history_file(c['HISTORY_FILENAME']) + except: + pass def save_history(): """ Save history to file """ - readline.write_history_file(c['HISTORY_FILENAME']) + try: + readline.write_history_file(c['HISTORY_FILENAME']) + except: + pass def init_interactive_shell(d): @@ -84,12 +89,8 @@ def init_interactive_shell(d): Init the rainbow shell """ readline.set_completer(RainbowCompleter(d).complete) - readline.parse_and_bind('set editing-mode vi') - readline.parse_and_bind('set show-all-if-ambiguous on') - readline.parse_and_bind('set show-all-if-unmodified on') readline.parse_and_bind('set skip-completed-text on') if 'libedit' in readline.__doc__: readline.parse_and_bind("bind ^I rl_complete") else: readline.parse_and_bind("tab: complete") -