From 0c730f424c3551ab48547e14fbd8b1ceb4f49726 Mon Sep 17 00:00:00 2001 From: jiangchen <1703935164@qq.com> Date: Sun, 27 Sep 2026 14:04:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(shell):=20-NoExclude=20=E5=8F=AA=E4=BD=9C?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E6=9C=AC=E6=AC=A1=E8=BF=90=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E5=86=99=E5=9B=9E=E7=8A=B6=E6=80=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=88=E9=81=BF=E5=85=8D=E8=B0=83=E8=AF=95=E5=90=8E?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=A4=B1=E5=8E=BB=E6=8A=93=E5=B1=8F=E9=9A=90?= =?UTF-8?q?=E8=BA=AB=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/float-window.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shell/float-window.ps1 b/shell/float-window.ps1 index 69b2f0f..822cf55 100644 --- a/shell/float-window.ps1 +++ b/shell/float-window.ps1 @@ -213,9 +213,16 @@ if (Test-Path $stateFile) { $script:state.fullscreen = $false } catch { Write-Warning "state file ignored: $($_.Exception.Message)" } } +# -NoExclude 只是本次运行的调试开关,不允许被写回状态文件(否则以后默认就不隐身了) +$script:persistExclude = [bool]$script:state.exclude function Save-State { - try { ($script:state | ConvertTo-Json -Depth 3) | Set-Content -Path $stateFile -Encoding UTF8 } catch {} + try { + $out = [ordered]@{} + foreach ($k in $script:state.Keys) { $out[$k] = $script:state[$k] } + if ($NoExclude) { $out.exclude = $script:persistExclude } + ($out | ConvertTo-Json -Depth 3) | Set-Content -Path $stateFile -Encoding UTF8 + } catch {} } # ---------------------------------------------------------------- 窗口