Browse Source

Merge pull request #286 from Tinyu-Zhao/master

修复在macOS下会将系统进程CursorUIViewService识别成Cursor进程的错误
pull/289/head v0.0.120
煎饼果子卷鲨鱼辣椒 3 months ago
committed by GitHub
parent
commit
a9bb8ab031
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      scripts/run/cursor_mac_id_modifier.sh

8
scripts/run/cursor_mac_id_modifier.sh

@ -69,11 +69,12 @@ check_and_kill_cursor() {
get_process_details() {
local process_name="$1"
log_debug "正在获取 $process_name 进程详细信息:"
ps aux | grep -i "$process_name" | grep -v grep
ps aux | grep -i "/Applications/Cursor.app" | grep -v grep
}
while [ $attempt -le $max_attempts ]; do
CURSOR_PIDS=$(pgrep -i "cursor" || true)
# 使用更精确的匹配来获取 Cursor 进程
CURSOR_PIDS=$(ps aux | grep -i "/Applications/Cursor.app" | grep -v grep | awk '{print $2}')
if [ -z "$CURSOR_PIDS" ]; then
log_info "未发现运行中的 Cursor 进程"
@ -94,7 +95,8 @@ check_and_kill_cursor() {
sleep 1
if ! pgrep -i "cursor" > /dev/null; then
# 同样使用更精确的匹配来检查进程是否还在运行
if ! ps aux | grep -i "/Applications/Cursor.app" | grep -v grep > /dev/null; then
log_info "Cursor 进程已成功关闭"
return 0
fi

Loading…
Cancel
Save