Fix REPL completions on OS X

This commit is contained in:
Henrique Carvalho Alves 2013-12-03 00:58:59 -02:00
parent 63a9e35f7f
commit 1b7d7bcef7

View File

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