Theia API Documentation v1.77.0
    Preparing search index...

    @theia/core service with some process-related utilities.

    Index
    logger: ILogger
    • Runs the given executable without blocking the event loop.

      Parameters

      • file: string
      • argv: string[]
      • Optionaloptions: ExecFileOptions

      Returns Promise<{ stderr: string; stdout: string }>

      if the executable cannot be run or exits with a non-zero code, or on timeout

    • Parameters

      • file: string
      • argv: string[]
      • Optionaloptions: SpawnSyncOptions

      Returns SpawnSyncReturns<string>

    • Kills all of the descendants of the given process, but not the process itself, without blocking the event loop.

      Parameters

      • ppid: number

      Returns Promise<void>

      if the descendants of the process cannot be listed

    • Kills the given process together with all of its descendants.

      This blocks the event loop, so that it can run in an exit handler, where the loop is no longer available. Prefer terminateChildProcessTrees while the event loop is running, as listing the descendants of a process can be slow, in particular on Windows.

      Parameters

      • ppid: number

      Returns void

    • Parameters

      • psOutput: string

        the output of ps ax -o ppid=,pid=

      • ppid: number

      Returns Set<number>

      the PIDs of all of the descendants of the given process

    • Parameters

      • ppid: number

      Returns string[]

      the arguments of a PowerShell command that prints the PIDs of the direct children of the given process, one per line, except for:

      • the PowerShell process that lists them, which is a child of the current process and exits right after
      • the console host (conhost.exe) that Windows attaches to a process launched without a console, which taskkill may fail to kill
      • processes created before the given process: Windows does not update the parent of a process when the parent exits and reuses PIDs, so these are the orphans of a previous process with the same PID
    • Returns string

      the absolute path of Windows PowerShell, so that it does not depend on the PATH, or just its name if the Windows directory is unknown.