From 4c4c7d91d087e5a06bc9d32ef5ff0ce7b7421355 Mon Sep 17 00:00:00 2001 From: oliver Date: Tue, 13 Oct 2026 19:18:47 +0800 Subject: [PATCH] Give background children an empty stdin so Vite stops eating shell keystrokes. Co-Authored-By: Claude Opus 5.5 --- scripts/start_netx.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/start_netx.ps1 b/scripts/start_netx.ps1 index d1ba8ea..9faf35c 100644 --- a/scripts/start_netx.ps1 +++ b/scripts/start_netx.ps1 @@ -53,6 +53,10 @@ $bizStateWorkerPidDir = Join-Path $runDir "biz_state_workers" $webPidFile = Join-Path $runDir "web.pid" $webLogFile = Join-Path $runDir "web.out.log" $webErrFile = Join-Path $runDir "web.err.log" +# Children share this console; give them an empty stdin so Vite (raw-mode CLI shortcuts) +# and python cannot steal keystrokes from the shell that launched them. +$nullStdin = Join-Path $runDir "stdin.empty" +if (-not (Test-Path -LiteralPath $nullStdin)) { New-Item -ItemType File -Path $nullStdin -Force | Out-Null } $venvPython = Join-Path $projectRoot ".venv\Scripts\python.exe" if (Get-Command Test-NetxVenvRunnable -ErrorAction SilentlyContinue) { @@ -184,6 +188,7 @@ function Start-NetxWorker { -ArgumentList @("-m", "netx_api.worker") ` -WorkingDirectory $projectRoot ` -WindowStyle Hidden ` + -RedirectStandardInput $nullStdin ` -RedirectStandardOutput $outLog ` -RedirectStandardError $errLog ` -PassThru @@ -228,6 +233,7 @@ function Start-BizStateWorkers { -ArgumentList @("-m", "netx_api.biz_state_worker") ` -WorkingDirectory $projectRoot ` -WindowStyle Hidden ` + -RedirectStandardInput $nullStdin ` -RedirectStandardOutput $outLog ` -RedirectStandardError $errLog ` -PassThru @@ -251,6 +257,7 @@ if ($Background) { -ArgumentList @("-m", "netx_api.main") ` -WorkingDirectory $projectRoot ` -WindowStyle Hidden ` + -RedirectStandardInput $nullStdin ` -RedirectStandardOutput $logFile ` -RedirectStandardError $errFile ` -PassThru @@ -293,6 +300,7 @@ if ($Background) { -ArgumentList @("run", "dev", "--", "--host", $BindHost, "--port", "$WebPort") ` -WorkingDirectory $webRoot ` -WindowStyle Hidden ` + -RedirectStandardInput $nullStdin ` -RedirectStandardOutput $webLogFile ` -RedirectStandardError $webErrFile ` -PassThru @@ -332,6 +340,7 @@ if ($WithWeb) { -ArgumentList @("run", "dev", "--", "--host", $BindHost, "--port", "$WebPort") ` -WorkingDirectory $webRoot ` -WindowStyle Hidden ` + -RedirectStandardInput $nullStdin ` -RedirectStandardOutput $webLogFile ` -RedirectStandardError $webErrFile ` -PassThru