fullcourtdefense-cli 1.25.6 → 1.25.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/shellGuard.js +8 -0
- package/dist/version.json +1 -1
- package/package.json +1 -1
|
@@ -630,9 +630,15 @@ function buildGuardPs1(nodePath, cliEntry) {
|
|
|
630
630
|
` try { $hit = Test-FcdShellGuard -CommandLine $line } catch { $hit = $null }`,
|
|
631
631
|
` }`,
|
|
632
632
|
` if ($null -ne $hit) {`,
|
|
633
|
+
` # Writing from inside a PSReadLine key handler races the line redraw:`,
|
|
634
|
+
` # on AcceptLine PSReadLine repaints the buffer at its saved coordinates,`,
|
|
635
|
+
` # which can overwrite the message (it flashes and disappears — seen in`,
|
|
636
|
+
` # Cursor/VS Code terminals). InvokePrompt() re-renders the prompt+buffer`,
|
|
637
|
+
` # BELOW the message so the warning stays in the scrollback permanently.`,
|
|
633
638
|
` if ($global:FcdGuardMode -eq 'monitor') {`,
|
|
634
639
|
` Write-Host ''`,
|
|
635
640
|
` Write-Host ('[FullCourtDefense] monitor: would block [' + $hit.Severity + '] ' + $hit.Reason + ' (rule ' + $hit.Id + ')') -ForegroundColor Yellow`,
|
|
641
|
+
` try { [Microsoft.PowerShell.PSConsoleReadLine]::InvokePrompt() } catch { }`,
|
|
636
642
|
` Write-FcdGuardEvent -Rule $hit -CommandLine $line -Decision 'warn'`,
|
|
637
643
|
` [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()`,
|
|
638
644
|
` return`,
|
|
@@ -641,6 +647,7 @@ function buildGuardPs1(nodePath, cliEntry) {
|
|
|
641
647
|
` if ($hit.Action -eq 'warn') {`,
|
|
642
648
|
` Write-Host ''`,
|
|
643
649
|
` Write-Host ('[FullCourtDefense] warning [' + $hit.Severity + ']: ' + $hit.Reason + ' (rule ' + $hit.Id + ') — allowed by org policy, reported to your security dashboard.') -ForegroundColor Yellow`,
|
|
650
|
+
` try { [Microsoft.PowerShell.PSConsoleReadLine]::InvokePrompt() } catch { }`,
|
|
644
651
|
` Write-FcdGuardEvent -Rule $hit -CommandLine $line -Decision 'warn'`,
|
|
645
652
|
` [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()`,
|
|
646
653
|
` return`,
|
|
@@ -649,6 +656,7 @@ function buildGuardPs1(nodePath, cliEntry) {
|
|
|
649
656
|
` Write-Host ''`,
|
|
650
657
|
` Write-Host ('[FullCourtDefense] BLOCKED [' + $hit.Severity + ']: ' + $hit.Reason + ' (rule ' + $hit.Id + ')') -ForegroundColor Red`,
|
|
651
658
|
` Write-Host 'This command was not executed. Reported to your security dashboard.' -ForegroundColor DarkGray`,
|
|
659
|
+
` try { [Microsoft.PowerShell.PSConsoleReadLine]::InvokePrompt() } catch { }`,
|
|
652
660
|
` Write-FcdGuardEvent -Rule $hit -CommandLine $line -Decision 'block'`,
|
|
653
661
|
` [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()`,
|
|
654
662
|
` return`,
|
package/dist/version.json
CHANGED