@@ -406,7 +406,6 @@ export const isWsl = async (
406
406
407
407
interface OpenOptions {
408
408
args : string [ ]
409
- options : cp . SpawnOptions
410
409
command : string
411
410
urlSearch : string
412
411
}
@@ -422,7 +421,6 @@ interface OpenOptions {
422
421
*/
423
422
export function constructOpenOptions ( platform : NodeJS . Platform | "wsl" , urlSearch : string ) : OpenOptions {
424
423
const args : string [ ] = [ ]
425
- const options : cp . SpawnOptions = { }
426
424
let command = platform === "darwin" ? "open" : "xdg-open"
427
425
if ( platform === "win32" || platform === "wsl" ) {
428
426
command = platform === "wsl" ? "cmd.exe" : "cmd"
@@ -433,7 +431,6 @@ export function constructOpenOptions(platform: NodeJS.Platform | "wsl", urlSearc
433
431
return {
434
432
args,
435
433
command,
436
- options,
437
434
urlSearch,
438
435
}
439
436
}
@@ -451,8 +448,9 @@ export const open = async (address: URL | string): Promise<void> => {
451
448
url . hostname = "localhost"
452
449
}
453
450
const platform = ( await isWsl ( process . platform , os . release ( ) , "/proc/version" ) ) ? "wsl" : process . platform
454
- const { command, args, options } = constructOpenOptions ( platform , url . search )
455
- const proc = cp . spawn ( command , [ ...args , url . toString ( ) ] , options )
451
+ const { command, args, urlSearch } = constructOpenOptions ( platform , url . search )
452
+ url . search = urlSearch
453
+ const proc = cp . spawn ( command , [ ...args , url . toString ( ) ] , { } )
456
454
await new Promise < void > ( ( resolve , reject ) => {
457
455
proc . on ( "error" , reject )
458
456
proc . on ( "close" , ( code ) => {
0 commit comments