contextswitch 0.1.9 → 0.1.10
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.
|
@@ -190,6 +190,8 @@ ${script}`);
|
|
|
190
190
|
detached: true,
|
|
191
191
|
stdio: "ignore"
|
|
192
192
|
});
|
|
193
|
+
proc2.on("error", () => {
|
|
194
|
+
});
|
|
193
195
|
proc2.unref();
|
|
194
196
|
return proc2.pid || 0;
|
|
195
197
|
} catch {
|
|
@@ -203,18 +205,24 @@ ${script}`);
|
|
|
203
205
|
debug("process", `PowerShell script:
|
|
204
206
|
${psScript}`);
|
|
205
207
|
const useTab = mode === "tab";
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
const wtInstalled = this.isCommandAvailable("wt.exe");
|
|
209
|
+
debug("process", `Windows Terminal available: ${wtInstalled}`);
|
|
210
|
+
if (wtInstalled) {
|
|
211
|
+
try {
|
|
212
|
+
const wtArgs = useTab ? ["-w", "0", "nt", "powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile] : ["powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile];
|
|
213
|
+
const proc2 = spawn("wt.exe", wtArgs, {
|
|
214
|
+
detached: true,
|
|
215
|
+
stdio: "ignore",
|
|
216
|
+
windowsHide: false
|
|
217
|
+
});
|
|
218
|
+
proc2.on("error", () => {
|
|
219
|
+
});
|
|
220
|
+
proc2.unref();
|
|
221
|
+
debug("process", "Launched via Windows Terminal (wt.exe)");
|
|
222
|
+
return proc2.pid || 0;
|
|
223
|
+
} catch {
|
|
224
|
+
debug("process", "Windows Terminal launch failed, falling back");
|
|
225
|
+
}
|
|
218
226
|
}
|
|
219
227
|
try {
|
|
220
228
|
const proc2 = spawn("cmd.exe", ["/c", "start", "powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile], {
|
|
@@ -222,6 +230,8 @@ ${psScript}`);
|
|
|
222
230
|
stdio: "ignore",
|
|
223
231
|
windowsHide: false
|
|
224
232
|
});
|
|
233
|
+
proc2.on("error", () => {
|
|
234
|
+
});
|
|
225
235
|
proc2.unref();
|
|
226
236
|
debug("process", "Launched via PowerShell (cmd start)");
|
|
227
237
|
return proc2.pid || 0;
|
|
@@ -236,6 +246,8 @@ ${psScript}`);
|
|
|
236
246
|
stdio: "ignore",
|
|
237
247
|
windowsHide: false
|
|
238
248
|
});
|
|
249
|
+
proc2.on("error", () => {
|
|
250
|
+
});
|
|
239
251
|
proc2.unref();
|
|
240
252
|
debug("process", "Launched via Git Bash");
|
|
241
253
|
return proc2.pid || 0;
|
|
@@ -369,6 +381,18 @@ ${psScript}`);
|
|
|
369
381
|
}
|
|
370
382
|
return parts;
|
|
371
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* Check if a command is available on the system PATH.
|
|
386
|
+
*/
|
|
387
|
+
isCommandAvailable(cmd) {
|
|
388
|
+
try {
|
|
389
|
+
const which = this.platform === "win32" ? "where" : "which";
|
|
390
|
+
execSync(`${which} ${cmd}`, { stdio: "ignore" });
|
|
391
|
+
return true;
|
|
392
|
+
} catch {
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
372
396
|
findGitBash() {
|
|
373
397
|
if (this.platform !== "win32") return null;
|
|
374
398
|
const candidates = [
|
package/dist/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ function getVersion() {
|
|
|
24
24
|
const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
|
|
25
25
|
return packageJson.version;
|
|
26
26
|
} catch {
|
|
27
|
-
return "0.1.
|
|
27
|
+
return "0.1.10";
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
function processSessionFallbackMarker() {
|
|
@@ -193,7 +193,7 @@ program.command("switch <domain>").description("Switch to a domain and launch Cl
|
|
|
193
193
|
console.error(pc.red(`\u274C Invalid launch mode '${options.mode}'. Must be: window, tab, or inline`));
|
|
194
194
|
process.exit(1);
|
|
195
195
|
}
|
|
196
|
-
const { switchCommand } = await import("./switch-
|
|
196
|
+
const { switchCommand } = await import("./switch-B76YGZCJ.js");
|
|
197
197
|
await switchCommand(domain, options);
|
|
198
198
|
});
|
|
199
199
|
program.command("reset <domain>").description("Reset a domain session (archives current session by default)").option("--skip-archive", "Skip archiving the current session").option("-f, --force", "Skip confirmation prompt").action(async (domain, options) => {
|
|
@@ -299,7 +299,7 @@ domainCmd.command("remove <name>").alias("rm").description("Remove a domain from
|
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
301
|
program.command("doctor").description("Check system configuration and diagnose issues").action(async () => {
|
|
302
|
-
const { processManager } = await import("./process-
|
|
302
|
+
const { processManager } = await import("./process-AOZWZKS4.js");
|
|
303
303
|
console.log(pc.cyan("\u{1FA7A} Running diagnostics...\n"));
|
|
304
304
|
const failures = [];
|
|
305
305
|
const claudeInstalled = processManager.verifyClaudeInstalled();
|