diff --git a/hy/completer.py b/hy/completer.py index 96c46af..d32deaf 100644 --- a/hy/completer.py +++ b/hy/completer.py @@ -26,6 +26,7 @@ # DEALINGS IN THE SOFTWARE. import os +import sys from contextlib import contextmanager docomplete = True @@ -40,6 +41,12 @@ except ImportError: except ImportError: docomplete = False +if sys.platform == 'darwin': + readline_bind = "bind ^I rl_complete" +else: + readline_bind = "tab: complete" + + import hy.macros import hy.compiler @@ -94,7 +101,7 @@ def completion(completer=None): except IOError: open(history, 'a').close() - readline.parse_and_bind("tab: complete") + readline.parse_and_bind(readline_bind) yield