diff --git a/packages/react-cy-dev-utils/getProcessForPort.js b/packages/react-cy-dev-utils/getProcessForPort.js index bf0ddc2d405..7b7ce0bd4f0 100644 --- a/packages/react-cy-dev-utils/getProcessForPort.js +++ b/packages/react-cy-dev-utils/getProcessForPort.js @@ -43,7 +43,7 @@ function getProcessCommand(processId, processDirectory) { } function getDirectoryOfProcessById(processId) { - return execSync('lsof -p '+ processId + ' | grep cwd | awk \'{print $9}\'', execOptions).trim(); + return execSync('lsof -p '+ processId + ' | awk \'$4=="cwd" {print $9}\'', execOptions).trim(); } function getProcessForPort(port) {