From f0facf368056580d5df5e8c30603a8ae9b7eb62c Mon Sep 17 00:00:00 2001 From: Miguel Campos Date: Sun, 22 Mar 2026 09:27:07 -0700 Subject: [PATCH] try fix path resolution for windows rdp --- src/plugins/proxy/rdp.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/plugins/proxy/rdp.ts b/src/plugins/proxy/rdp.ts index f8c960e5..62830461 100644 --- a/src/plugins/proxy/rdp.ts +++ b/src/plugins/proxy/rdp.ts @@ -43,6 +43,10 @@ const createSession = async ( if (debug) { print2(`Creating proxy RDP session for target: ${instanceId}`); + print2(`API endpoint: ${bastionUrl}/api/sessions`); + print2( + `API key: ${bastionApiKey.slice(0, 4)}...${bastionApiKey.slice(-4)}` + ); } const response = await fetch(`${bastionUrl}/api/sessions`, { @@ -98,15 +102,20 @@ const downloadRdpFile = async ( mode: 0o600, prefix: "p0cli-", postfix: ".rdp", + discardDescriptor: true, }); await fs.promises.writeFile(tmpPath, rdpContent, { encoding: "utf-8" }); + // Resolve 8.3 short paths (e.g. MIGUEL~1) to long paths, as mstsc + // on Windows cannot open files referenced by short names. + const resolvedPath = await fs.promises.realpath(tmpPath); + if (debug) { - print2(`RDP file saved to: ${tmpPath}`); + print2(`RDP file saved to: ${resolvedPath}`); } - return tmpPath; + return resolvedPath; }; const openRdpFile = async (