Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lang_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down