MCPcopy Index your code
hub / github.com/coder/code-server / constructOpenOptions

Function constructOpenOptions

src/node/util.ts:407–421  ·  view source on GitHub ↗
(platform: NodeJS.Platform | "wsl", urlSearch: string)

Source from the content-addressed store, hash-verified

405 * @returns an object with args, command, options and urlSearch
406 */
407export function constructOpenOptions(platform: NodeJS.Platform | "wsl", urlSearch: string): OpenOptions {
408 const args: string[] = []
409 let command = platform === "darwin" ? "open" : "xdg-open"
410 if (platform === "win32" || platform === "wsl") {
411 command = platform === "wsl" ? "cmd.exe" : "cmd"
412 args.push("/c", "start", '""', "/b")
413 urlSearch = urlSearch.replace(/&/g, "^&")
414 }
415
416 return {
417 args,
418 command,
419 urlSearch,
420 }
421}
422
423/**
424 * Try opening an address using whatever the system has set for opening URLs.

Callers 1

openFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected