core/discord
Interfaces
DiscordProcess
Defined in: venpm/src/core/discord.ts:5
Properties
exe
exe: string;Defined in: venpm/src/core/discord.ts:7
pid
pid: number;Defined in: venpm/src/core/discord.ts:6
KillResult
Defined in: venpm/src/core/discord.ts:10
Properties
forced
forced: number[];Defined in: venpm/src/core/discord.ts:13
found
found: DiscordProcess[];Defined in: venpm/src/core/discord.ts:11
killed
killed: number[];Defined in: venpm/src/core/discord.ts:12
Functions
findDiscordProcesses()
function findDiscordProcesses(
fs,
shell,
configuredBinary?,
platform?): Promise<DiscordProcess[]>;Defined in: venpm/src/core/discord.ts:83
Find running Discord processes on Linux by inspecting /proc/<pid>/exe. Only returns processes whose binary resolves to a known Discord path.
On non-Linux platforms, falls back to ps output parsing (macOS) or returns an empty array (Windows — handled separately by the caller).
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
fs | FileSystem | undefined | - |
shell | ShellRunner | undefined | - |
configuredBinary? | string | null | undefined | - |
platform? | Platform | process.platform | Which platform's discovery to use. Defaults to the host's, but callers that already resolve a platform must pass it — otherwise a caller targeting Linux silently gets the host's discovery instead, which is how the launch tests hung when run on macOS. |
Returns
Promise<DiscordProcess[]>
findDiscordProcessesWin32()
function findDiscordProcessesWin32(shell, configuredBinary?): Promise<DiscordProcess[]>;Defined in: venpm/src/core/discord.ts:112
Windows has no /proc and no ps, so liveness comes from tasklist CSV output. Image names only — enough to answer "is Discord running?", which is what restart verification needs.
Parameters
| Parameter | Type |
|---|---|
shell | ShellRunner |
configuredBinary? | string | null |
Returns
Promise<DiscordProcess[]>
isDiscordBinary()
function isDiscordBinary(resolvedPath, configuredBinary?): boolean;Defined in: venpm/src/core/discord.ts:68
Check whether a resolved binary path belongs to a Discord installation. Matches against known install locations + the user's configured binary.
Parameters
| Parameter | Type |
|---|---|
resolvedPath | string |
configuredBinary? | string | null |
Returns
boolean
killDiscordProcesses()
function killDiscordProcesses(
fs,
shell,
configuredBinary?): Promise<KillResult>;Defined in: venpm/src/core/discord.ts:241
Kill all running Discord processes with SIGTERM → wait → SIGKILL escalation.
- Discovers processes via
/proc/<pid>/exe(Linux) orps(macOS) - Sends SIGTERM to all matching PIDs
- Waits up to 5 s for graceful exit (polling every 250 ms)
- Sends SIGKILL to any survivors
- Waits up to 2 s for forced exit
On Windows, falls back to taskkill /F against the configured binary name.
Parameters
| Parameter | Type |
|---|---|
fs | FileSystem |
shell | ShellRunner |
configuredBinary? | string | null |
Returns
Promise<KillResult>