diff --git a/CHANGELOG.md b/CHANGELOG.md index b27cb33..9879f0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Snippets: Updated all snippets to use `v0.28.0` schema - Commands: Removed configuration commands from editor +- Detection: Improved detection of Dev Proxy processes ### Fixed: diff --git a/src/detect.ts b/src/detect.ts index 2925b03..019bde5 100644 --- a/src/detect.ts +++ b/src/detect.ts @@ -54,11 +54,11 @@ export const isDevProxyRunning = async (devProxyExe: string): Promise = return processId.trim() !== ''; }; if (platform === 'darwin') { - const processId = await executeCommand(`$SHELL -c "ps -ef | grep ${devProxyExe} | grep -v grep | awk '{print $2}'"`); + const processId = await executeCommand(`$SHELL -c "ps -e -o pid=,comm= | awk \'\\$2==\"${devProxyExe}\" {print \\$1}\'"`); return processId.trim() !== ''; }; if (platform === 'linux') { - const processId = await executeCommand(`/bin/bash -c "ps -ef | grep ${devProxyExe} | grep -v grep | awk '{print $2}'"`); + const processId = await executeCommand(`/bin/bash -c "ps -e -o pid=,comm= | awk \'\\$2==\"${devProxyExe}\" {print \\$1}\'"`); return processId.trim() !== ''; } return false;