优化Win显示路径

让Win跟Linux一样可以显示缩短路径
以前 C:\Users\test\project\src\index.ts
现在 …/project/src/index.ts
This commit is contained in:
Raphaelowo 2026-07-14 01:52:35 +08:00 committed by GitHub
parent d1e684c419
commit d79959c355
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -223,7 +223,7 @@ function formatToolSummary(tool: string, inp: Record<string, unknown>): string |
}
function shortPath(fp: string): string {
const parts = fp.split('/')
const parts = fp.replaceAll('\\', '/').split('/')
return parts.length > 3 ? '…/' + parts.slice(-3).join('/') : fp
}