Skip to content

Commit 8b7d360

Browse files
Carreaujonathanslenders
authored andcommitted
Handle arguments in the $EDITOR or $VISUAL env variable
On OSX, users will typically use `subl -w` to use sublime tet on blocking mode, though this will be passed ass it to subprocess.call leading to the `subl -w` command not found. See ipython/ipython#9929 this should fix that. It would affect users with actual space on the path of their editor executable, but I'm unsure how to handle both case. It seem to me like passing flags would be the most common use case. Workaround is to tell users to create an shim executable which pass the options.
1 parent 0a608c8 commit 8b7d360

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prompt_toolkit/buffer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ def _open_file_in_editor(self, filename):
13161316
for e in editors:
13171317
if e:
13181318
try:
1319-
returncode = subprocess.call([e, filename])
1319+
returncode = subprocess.call(e.split(' ') + [filename])
13201320
return returncode == 0
13211321

13221322
except OSError:

0 commit comments

Comments
 (0)