File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,12 @@ check_and_kill_cursor() {
6969 get_process_details () {
7070 local process_name=" $1 "
7171 log_debug " 正在获取 $process_name 进程详细信息:"
72- ps aux | grep -i " $process_name " | grep -v grep
72+ ps aux | grep -i " /Applications/Cursor.app " | grep -v grep
7373 }
7474
7575 while [ $attempt -le $max_attempts ]; do
76- CURSOR_PIDS=$( pgrep -i " cursor" || true)
76+ # 使用更精确的匹配来获取 Cursor 进程
77+ CURSOR_PIDS=$( ps aux | grep -i " /Applications/Cursor.app" | grep -v grep | awk ' {print $2}' )
7778
7879 if [ -z " $CURSOR_PIDS " ]; then
7980 log_info " 未发现运行中的 Cursor 进程"
@@ -94,7 +95,8 @@ check_and_kill_cursor() {
9495
9596 sleep 1
9697
97- if ! pgrep -i " cursor" > /dev/null; then
98+ # 同样使用更精确的匹配来检查进程是否还在运行
99+ if ! ps aux | grep -i " /Applications/Cursor.app" | grep -v grep > /dev/null; then
98100 log_info " Cursor 进程已成功关闭"
99101 return 0
100102 fi
You can’t perform that action at this time.
0 commit comments