@ekkos/cli 1.0.14 → 1.0.15
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/run.js +17 -10
- package/package.json +1 -1
package/dist/commands/run.js
CHANGED
|
@@ -844,20 +844,27 @@ function launchWithDashboardWindows(options) {
|
|
|
844
844
|
fs.writeFileSync(markerPath, `${launchTime}\n${cwd}`);
|
|
845
845
|
}
|
|
846
846
|
catch { }
|
|
847
|
-
// Use
|
|
848
|
-
//
|
|
849
|
-
|
|
847
|
+
// Use -EncodedCommand (UTF-16LE Base64) to pass PowerShell scripts to wt panes.
|
|
848
|
+
// This completely avoids nested quote hell: cmd.exe sees no " inside the wt command string,
|
|
849
|
+
// and PowerShell decodes the base64 itself, preserving backslashes and special chars exactly.
|
|
850
|
+
const ekkosCmdEscaped = ekkosCmd.replace(/'/g, "''");
|
|
850
851
|
const cwdEscaped = cwd.replace(/'/g, "''");
|
|
852
|
+
function toPsEncoded(script) {
|
|
853
|
+
// PowerShell -EncodedCommand expects UTF-16LE Base64
|
|
854
|
+
return Buffer.from(script, 'utf16le').toString('base64');
|
|
855
|
+
}
|
|
851
856
|
// cd to original CWD first so ekkos run --kickstart registers the correct projectPath
|
|
852
|
-
const
|
|
853
|
-
const
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
//
|
|
857
|
+
const runScript = `Set-Location '${cwdEscaped}'; & node '${ekkosCmdEscaped}' ${runArgs.join(' ')}`;
|
|
858
|
+
const dashScript = `& node '${ekkosCmdEscaped}' dashboard --wait-for-new --refresh 2000`;
|
|
859
|
+
const runEncoded = toPsEncoded(runScript);
|
|
860
|
+
const dashEncoded = toPsEncoded(dashScript);
|
|
861
|
+
// Windows Terminal split pane command.
|
|
862
|
+
// No nested double-quotes in the PowerShell portion — only the WT --title/--startingDirectory
|
|
863
|
+
// values need quoting, which cmd.exe handles cleanly.
|
|
857
864
|
const wtCmd = [
|
|
858
865
|
'wt',
|
|
859
|
-
`new-tab --startingDirectory "${cwd}" --title
|
|
860
|
-
`; split-pane -V --size 0.4 --title
|
|
866
|
+
`new-tab --startingDirectory "${cwd}" --title ekkOS powershell -NoExit -EncodedCommand ${runEncoded}`,
|
|
867
|
+
`; split-pane -V --size 0.4 --title Dashboard powershell -NoExit -EncodedCommand ${dashEncoded}`
|
|
861
868
|
].join(' ');
|
|
862
869
|
try {
|
|
863
870
|
(0, child_process_1.execSync)(wtCmd, { stdio: 'inherit', shell: true });
|