Skip to content

Commit d444bbb

Browse files
authored
fix(cli): fix killAllDaemons to match actual daemon process command line (microsoft#39549)
1 parent 0b7635e commit d444bbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/playwright-core/src/cli/client/program.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ async function killAllDaemons(): Promise<void> {
294294
const result = execSync(
295295
`powershell -NoProfile -NonInteractive -Command `
296296
+ `"Get-CimInstance Win32_Process `
297-
+ `| Where-Object { $_.CommandLine -like '*-server*' -and $_.CommandLine -like '*--daemon-*' } `
297+
+ `| Where-Object { $_.CommandLine -like '*run-mcp-server*' -or $_.CommandLine -like '*run-cli-server*' } `
298298
+ `| ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; $_.ProcessId }"`,
299299
{ encoding: 'utf-8' }
300300
);
@@ -308,7 +308,7 @@ async function killAllDaemons(): Promise<void> {
308308
const result = execSync('ps aux', { encoding: 'utf-8' });
309309
const lines = result.split('\n');
310310
for (const line of lines) {
311-
if ((line.includes('-server')) && line.includes('--daemon-')) {
311+
if (line.includes('run-mcp-server') || line.includes('run-cli-server')) {
312312
const parts = line.trim().split(/\s+/);
313313
const pid = parts[1];
314314
if (pid && /^\d+$/.test(pid)) {

0 commit comments

Comments
 (0)