Skip to content

Commit c0fcdba

Browse files
enable multi-word values for EDITOR
--HG-- branch : scroll-frontend
1 parent 24b6daf commit c0fcdba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bpython/scrollfrontend/repl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,13 +809,14 @@ def getstdout(self):
809809
return s
810810
def send_to_external_editor(self, filename=None):
811811
editor = os.environ.get('VISUAL', os.environ.get('EDITOR', 'vim'))
812+
editor_args = editor.split()
812813
text = self.getstdout()
813814
with tempfile.NamedTemporaryFile(suffix='.py') as temp:
814815
temp.write('### current bpython session - file will be reevaluated, ### lines will not be run\n'.encode('utf8'))
815816
temp.write('\n'.join(line[4:] if line[:4] in ('... ', '>>> ') else '### '+line
816817
for line in text.split('\n')).encode('utf8'))
817818
temp.flush()
818-
subprocess.call([editor, temp.name])
819+
subprocess.call(editor_args + [temp.name])
819820
self.history = [line for line in open(temp.name).read().split('\n')
820821
if line[:4] != '### ']
821822
self.reevaluate(insert_into_history=True)

0 commit comments

Comments
 (0)