Skip to content

Commit e77c6d8

Browse files
committed
Fix extracting correct PID on Windows
1 parent 970bc5d commit e77c6d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/platform/terminal/node/ptyService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class PtyService extends Disposable implements IPtyService {
124124
await new Promise<string>((resolve, reject) => {
125125
exec(`kill ${processId}`, {}, (err, stdout) => {
126126
if (err) {
127-
return reject(`Problem occurred when killing the process w ID: ${processId}`);
127+
return reject(`Problem occurred when killing the process with PID: ${processId}`);
128128
}
129129
resolve(stdout);
130130
});
@@ -143,13 +143,13 @@ export class PtyService extends Disposable implements IPtyService {
143143
});
144144
const processesForPort = stdout.split('\n');
145145
if (processesForPort.length >= 1) {
146-
const capturePid = /LISTENING\s+(\d{3})/;
146+
const capturePid = /LISTENING\s+(\d+)/;
147147
const processId = processesForPort[0].match(capturePid)?.[1];
148148
if (processId) {
149149
await new Promise<string>((resolve, reject) => {
150150
exec(`Taskkill /F /PID ${processId}`, {}, (err, stdout) => {
151151
if (err) {
152-
return reject(`Problem occurred when killing the process w ID: ${processId}`);
152+
return reject(`Problem occurred when killing the process with PID: ${processId}`);
153153
}
154154
resolve(stdout);
155155
});

0 commit comments

Comments
 (0)