From fdab45fd20022ade4dd6b5e9e1a39638f28e3ba4 Mon Sep 17 00:00:00 2001 From: Jess Rasmussen Date: Tue, 18 Aug 2026 10:02:15 +0200 Subject: [PATCH] Fix(windows): Make os.sleep work with redirected stdin Replace timeout.exe with non-interactive PowerShell Start-Sleep for Windows. timeout.exe expects an interactive console and can fail when stdin is redirected, which can prevent RDB/IDB startup retries from working correctly and surface misleading os file-load errors. Using PowerShell Start-Sleep removes the dependency on interactive stdin while preserving the existing sleep behavior. --- code/common/os.q | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/common/os.q b/code/common/os.q index 90f86efec..877a0c038 100644 --- a/code/common/os.q +++ b/code/common/os.q @@ -19,7 +19,7 @@ Vex:not 0h~type key`.@ df:{(`$("/";"\\")[NT]sv -1_v;`$-1#v:("/";"\\")[NT]vs pth(string x;x)[10h=type x])} run:{system"q ",x} kill:{[p]@[(`::p);"\\\\";1];} -sleep:{x:string x; system("sleep ",x;"timeout /t ",x," >nul")[NT]} +sleep:{x:string x; system("sleep ",x;"powershell.exe -NoProfile -NonInteractive -Command Start-Sleep -Seconds ",x)[NT]} pthq:{[x] $[10h=type x;ssr [x;"\\";"/"];`$ -1 _ ssr [string (` sv x,`);"\\";"/"]]} ren:{[x;y] / Convert the incoming q values into OS path strings. @@ -31,4 +31,4 @@ ren:{[x;y] / Escape single quotes so a path can be embedded safely in a PowerShell literal string. psqlit:{[p] "'",ssr[p;"'";"''"],"'"}; / Move-Item gives us native Windows move semantics for files, directories and cross-volume moves. - :system "powershell -NoProfile -Command Move-Item -LiteralPath ",psqlit[src]," -Destination ",psqlit[dst]} \ No newline at end of file + :system "powershell -NoProfile -Command Move-Item -LiteralPath ",psqlit[src]," -Destination ",psqlit[dst]}