@@ -36,7 +36,7 @@ if !s:is_nvim
3636 endfunction
3737
3838 function ! s: _inner_err_cb (user_err_cb, ch , msg) abort
39- call a: user_err_cb (s: _ensure_buffer_string (result ))
39+ call a: user_err_cb (s: _ensure_buffer_string (a: msg ))
4040 endfunction
4141else
4242 " inner callbacks for Neovim
@@ -83,17 +83,6 @@ function! s:execute(command, options) abort
8383 throw ' vital: AsyncProcess: invalid argument (value type:' . type (a: command ) . ' )'
8484 endif
8585
86- " build args
87- let args = []
88- if stridx (&shell , ' cmd.exe' ) != -1
89- " cmd.exe
90- let args = args + [' /c' ]
91- else
92- " sh, bash, pwsh, etc.
93- let args = args + [' -c' ]
94- endif
95- let args = args + [command ]
96-
9786 let job_id = -1
9887 if s: is_nvim
9988 let options = {}
@@ -107,7 +96,7 @@ function! s:execute(command, options) abort
10796 let options [' on_exit' ] = function (' s:_inner_exit_cb' , [a: options .exit_cb])
10897 endif
10998
110- let job_id = jobstart ([& shell ] + args , options )
99+ let job_id = jobstart (command , options )
111100
112101 if has_key (a: options , ' timeout' )
113102 if a: options .timeout > 0
@@ -130,7 +119,7 @@ function! s:execute(command, options) abort
130119 let options [' exit_cb' ] = function (' s:_inner_exit_cb' , [a: options .exit_cb])
131120 endif
132121
133- let job = job_start ([& shell ] + args , options )
122+ let job = job_start (command , options )
134123
135124 if has_key (a: options , ' timeout' )
136125 if a: options .timeout > 0
0 commit comments