Index: Lib/cmd.py =================================================================== --- Lib/cmd.py (revision 82275) +++ Lib/cmd.py (working copy) @@ -112,7 +112,18 @@ import readline self.old_completer = readline.get_completer() readline.set_completer(self.complete) - readline.parse_and_bind(self.completekey+": complete") + + if 'libedit' in readline.__doc__: + # readline linked to BSD libedit + if self.completekey == 'tab': + key = '^I' + else: + key = self.completekey + readline.parse_and_bind("bind %s rl_complete"%(key,)) + + else: + # readline linked to the real readline + readline.parse_and_bind(self.completekey+": complete") except ImportError: pass try: