@@ -44,7 +44,21 @@ export async function main(denops: Denops): Promise<void> {
4444 "-N" , // No compatible
4545 "-n" , // No swapfile
4646 "-X" , // Do not try connecting to the X server
47- "-es" , // Ex batch mode
47+ // Ex mode
48+ // On Windows, when `-e` is specified, calls via non-terminal (e.g. job or Deno)
49+ // hang for some reason.
50+ // However, if you do not use `-e`, you will get the following warnings
51+ //
52+ // Vim: Warning: Output is not to a terminal
53+ // Vim: Warning: Input is not from a terminal
54+ //
55+ // For now, we don't know how to deal with these warnings, so we are treating
56+ // them as specifications.
57+ ...( denops . meta . platform === "windows" ? [ ] : [ "-e" ] ) ,
58+ // Silent batch mode
59+ // On Windows, if `-s` is specified, for some reason, it immediately terminates
60+ // and does not function properly.
61+ ...( denops . meta . platform === "windows" ? [ ] : [ "-s" ] ) ,
4862 ] ;
4963 } else {
5064 args = [
@@ -53,7 +67,14 @@ export async function main(denops: Denops): Promise<void> {
5367 "--headless" ,
5468 ] ;
5569 }
56- await vars . e . set ( denops , "EDITOR" , `${ config . progpath } ${ args . join ( " " ) } ` ) ;
70+ const progpath = denops . meta . platform === "windows"
71+ ? `"${ config . progpath } "`
72+ : `'${ config . progpath } '` ;
73+ await vars . e . set (
74+ denops ,
75+ "EDITOR" ,
76+ `${ progpath } ${ args . join ( " " ) } ` ,
77+ ) ;
5778 }
5879}
5980
0 commit comments