From da9908fb6eef5748a2ad8583d419d25a1697fc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E6=9C=8D=E5=8A=A1=E9=83=A8-=E5=8F=B6=E6=9E=97?= =?UTF-8?q?=E7=AB=8B?= <1361666059@qq.com> Date: Tue, 20 Oct 2026 01:05:31 -0700 Subject: [PATCH] =?UTF-8?q?fix(pi-ssh):=20ssh=5Fgrep=20=E7=9A=84=20rg=20?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E5=9C=A8=E6=8C=87=E5=AE=9A=20include=20?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E5=86=8D=E6=90=9C=E5=85=A5=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rg 中后出现的 glob 优先,include glob 排在隐藏文件排除规则之后会把 排除覆盖掉,导致 includeHidden=false 时仍返回隐藏文件;调整参数顺序, 使 rg、git grep 与 grep 三种后端行为一致。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- pi-ssh/src/remote-search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pi-ssh/src/remote-search.ts b/pi-ssh/src/remote-search.ts index 45d4097..16dfae6 100644 --- a/pi-ssh/src/remote-search.ts +++ b/pi-ssh/src/remote-search.ts @@ -159,7 +159,7 @@ function grepPipeline(input: RemoteGrepInput, root: string, limit: number): stri `PI_SSH_INCLUDE_HIDDEN=${includeHidden}`, `if command -v rg >/dev/null 2>&1; then`, ` printf '${MARKER}ripgrep\\n'`, - ` rg --null --line-number --no-heading --color never --with-filename --max-columns ${MAX_LINE_CHARS} --max-columns-preview ${rgMode} ${insensitive} ${rgHidden} ${rgGlob} --glob '!.git/**' --glob '!node_modules/**' -- ${shellQuote(pattern)} ${shellQuote(root)} | pi_ssh_limit_colon_records`, + ` rg --null --line-number --no-heading --color never --with-filename --max-columns ${MAX_LINE_CHARS} --max-columns-preview ${rgMode} ${insensitive} ${rgGlob} ${rgHidden} --glob '!.git/**' --glob '!node_modules/**' -- ${shellQuote(pattern)} ${shellQuote(root)} | pi_ssh_limit_colon_records`, ' statuses=("${PIPESTATUS[@]}")', ' pi_ssh_accept_status "${statuses[0]}" 0 1 141 || exit $?', ' pi_ssh_accept_status "${statuses[1]}" 0 || exit $?',