From 3d742c9dbdd2d513e78af3ce46c178795bb5b73d Mon Sep 17 00:00:00 2001 From: Isaac Adjei Date: Wed, 18 Nov 2026 23:53:57 +0000 Subject: [PATCH] fix: skip a shell tool's init when the tool cannot start --- shell/windows/topics/06-functions.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shell/windows/topics/06-functions.ps1 b/shell/windows/topics/06-functions.ps1 index 9a3d608..e6905ee 100644 --- a/shell/windows/topics/06-functions.ps1 +++ b/shell/windows/topics/06-functions.ps1 @@ -367,7 +367,9 @@ function _cachedInit { $sources = @($Exe) + @($DependsOn | Where-Object { Test-Path $_ }) $newest = ($sources | ForEach-Object { (Get-Item $_).LastWriteTime } | Measure-Object -Maximum).Maximum if (-not (Test-Path $file) -or (Get-Item $file).LastWriteTime -lt $newest) { - $script = & $Exe @InitArgs | Out-String + # Smart App Control can refuse to start an unsigned tool (zoxide from winget is one), which + # is a terminating error that would print at the top of every new shell until it is allowed + try { $script = & $Exe @InitArgs | Out-String } catch { return } # an empty result (the tool failed) is never saved, so the next start tries again if (-not $script.Trim()) { return } if ($Transform) { $script = & $Transform $script }