@@ -23,7 +23,6 @@ type Options =
2323 args: string list
2424 program: string
2525 stderrenc: System .Text .Encoding
26- preArgs: string list
2726 server: ServerOptions
2827 }
2928
@@ -61,15 +60,6 @@ let parseOptions (args: string[]) =
6160 if wsl && ssh.IsSome then
6261 failwith " --wsl and --ssh cannot be used together."
6362
64- let prog = if wsl then " wsl" elif ssh.IsSome then " ssh" else nvim
65- let preargs = if wsl then [ " bash" ; " -l" ; " -c" ; " nvim" ] elif ssh.IsSome then [ ssh.Value; nvim] else []
66- let enc = if wsl then System.Text.Encoding.Unicode else System.Text.Encoding.UTF8
67-
68- let intent =
69- if setup then Setup
70- elif runDaemon then Daemon( port, pipe)
71- else Start
72-
7363 if terminal then
7464 let set x = " +\" set " + x + " \" "
7565 // fvim --wsl -u NORC +terminal +"set noshowmode" +"set laststatus=0" +"set noruler" +"set noshowcmd"
@@ -85,6 +75,33 @@ let parseOptions (args: string[]) =
8575 | None -> " +terminal"
8676 |> args.Add
8777
78+ let prog =
79+ if wsl then
80+ " wsl"
81+ elif ssh.IsSome then
82+ " ssh"
83+ else
84+ nvim
85+
86+ let args =
87+ if wsl then
88+ [ " bash" ; " -l" ; " -c" ; sprintf " nvim --embed %s " ( args |> escapeArgs |> join)]
89+ elif ssh.IsSome then
90+ [ ssh.Value; nvim; " --embed" ] @ ( List.ofSeq args)
91+ else
92+ [ " --embed" ] @ ( List.ofSeq args)
93+
94+ let enc =
95+ if wsl then
96+ System.Text.Encoding.Unicode
97+ else
98+ System.Text.Encoding.UTF8
99+
100+ let intent =
101+ if setup then Setup
102+ elif runDaemon then Daemon( port, pipe)
103+ else Start
104+
88105 let serveropts =
89106 if tryDaemon then
90107 TryDaemon
@@ -100,9 +117,8 @@ let parseOptions (args: string[]) =
100117 logToFile = trace_ to_ file
101118 logPatterns = trace_ patterns
102119 program = prog
103- args = List.ofSeq args
120+ args = args
104121 server = serveropts
105- preArgs = preargs
106122 stderrenc = enc
107123 intent = intent
108124 }
0 commit comments