File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1515
1616from __future__ import print_function
1717import os
18+ import portable
1819import re
1920import sys
2021import subprocess
@@ -83,8 +84,9 @@ def EditString(cls, data):
8384 fd = None
8485
8586 if re .compile ("^.*[$ \t '].*$" ).match (editor ):
86- args = [editor + ' "$@"' , 'sh' ]
87- shell = True
87+ # args = [editor + ' "$@"', 'sh']
88+ # shell = True
89+ (args , shell ) = portable .prepare_editor_args (editor )
8890 else :
8991 args = [editor ]
9092 shell = False
Original file line number Diff line number Diff line change @@ -274,3 +274,14 @@ def WaitForProcess():
274274 if child_process :
275275 child_process .stdin .close ()
276276 child_process .wait ()
277+
278+
279+ def prepare_editor_args (editor ):
280+ if isUnix ():
281+ args = [editor + ' "$@"' , 'sh' ]
282+ shell = True
283+ else :
284+ editor = re .sub ('["\' ]' , '' , editor )
285+ args = editor .rsplit ()
286+ shell = False
287+ return (args , shell )
You can’t perform that action at this time.
0 commit comments