diff --git a/lang_integration.py b/lang_integration.py index 62b92c2b..672ac48c 100644 --- a/lang_integration.py +++ b/lang_integration.py @@ -93,23 +93,26 @@ def run_virtualenv(self, choices, index): return (name, directory) = choices[index] activate_file = os.path.join(directory, "activate_this.py") - python_executable = os.path.join(directory, "python") + ipy = any(os.path.exists(os.path.join(directory, ipy)) for ipy in ["ipython", "ipython.exe"]) + python_executable = os.path.join(directory, "ipython" if ipy else "python") path_separator = ":" if os.name == "nt": python_executable += ".exe" # ;-) path_separator = ";" + if ipy: + python_cmdline = [python_executable, "-i"] + else: + python_cmdline = [python_executable, "-i", "-u"] self.window.run_command("repl_open", { "encoding":"utf8", "type": "subprocess", - "autocomplete_server": True, "extend_env": { "PATH": directory + path_separator + "{PATH}", - "SUBLIMEREPL_ACTIVATE_THIS": activate_file, "PYTHONIOENCODING": "utf-8" }, - "cmd": [python_executable, "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"], + "cmd": python_cmdline, "cwd": "$file_path", "encoding": "utf8", "syntax": "Packages/Python/Python.tmLanguage",