contextswitch 0.1.9 → 0.1.11

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,29 @@ ${script}`);
203
205
  debug("process", `PowerShell script:
204
206
  ${psScript}`);
205
207
  const useTab = mode === "tab";
206
- try {
207
- const wtArgs = useTab ? ["-w", "0", "nt", "powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile] : ["powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile];
208
- const proc2 = spawn("wt.exe", wtArgs, {
209
- detached: true,
210
- stdio: "ignore",
211
- windowsHide: false
212
- });
213
- proc2.unref();
214
- debug("process", "Launched via Windows Terminal (wt.exe)");
215
- return proc2.pid || 0;
216
- } catch {
217
- debug("process", "Windows Terminal not available, falling back");
208
+ const wtInstalled = this.isCommandAvailable("wt.exe");
209
+ debug("process", `Windows Terminal available: ${wtInstalled}`);
210
+ if (!wtInstalled && useTab) {
211
+ console.log("Note: Windows Terminal is not installed. Tabs require Windows Terminal.");
212
+ console.log("Install it from the Microsoft Store: https://aka.ms/terminal");
213
+ console.log("Opening in a new window instead.\n");
214
+ }
215
+ if (wtInstalled) {
216
+ try {
217
+ const wtArgs = useTab ? ["-w", "0", "nt", "powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile] : ["powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile];
218
+ const proc2 = spawn("wt.exe", wtArgs, {
219
+ detached: true,
220
+ stdio: "ignore",
221
+ windowsHide: false
222
+ });
223
+ proc2.on("error", () => {
224
+ });
225
+ proc2.unref();
226
+ debug("process", "Launched via Windows Terminal (wt.exe)");
227
+ return proc2.pid || 0;
228
+ } catch {
229
+ debug("process", "Windows Terminal launch failed, falling back");
230
+ }
218
231
  }
219
232
  try {
220
233
  const proc2 = spawn("cmd.exe", ["/c", "start", "powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile], {
@@ -222,6 +235,8 @@ ${psScript}`);
222
235
  stdio: "ignore",
223
236
  windowsHide: false
224
237
  });
238
+ proc2.on("error", () => {
239
+ });
225
240
  proc2.unref();
226
241
  debug("process", "Launched via PowerShell (cmd start)");
227
242
  return proc2.pid || 0;
@@ -236,6 +251,8 @@ ${psScript}`);
236
251
  stdio: "ignore",
237
252
  windowsHide: false
238
253
  });
254
+ proc2.on("error", () => {
255
+ });
239
256
  proc2.unref();
240
257
  debug("process", "Launched via Git Bash");
241
258
  return proc2.pid || 0;
@@ -369,6 +386,18 @@ ${psScript}`);
369
386
  }
370
387
  return parts;
371
388
  }
389
+ /**
390
+ * Check if a command is available on the system PATH.
391
+ */
392
+ isCommandAvailable(cmd) {
393
+ try {
394
+ const which = this.platform === "win32" ? "where" : "which";
395
+ execSync(`${which} ${cmd}`, { stdio: "ignore" });
396
+ return true;
397
+ } catch {
398
+ return false;
399
+ }
400
+ }
372
401
  findGitBash() {
373
402
  if (this.platform !== "win32") return null;
374
403
  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.9";
27
+ return "0.1.11";
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-IAY2Z3NL.js");
196
+ const { switchCommand } = await import("./switch-CJZHDQYU.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-U5LACM4X.js");
302
+ const { processManager } = await import("./process-MZG7SKJ5.js");
303
303
  console.log(pc.cyan("\u{1FA7A} Running diagnostics...\n"));
304
304
  const failures = [];
305
305
  const claudeInstalled = processManager.verifyClaudeInstalled();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ProcessManager,
3
3
  processManager
4
- } from "./chunk-V2PINWUG.js";
4
+ } from "./chunk-P7H2VG3B.js";
5
5
  import "./chunk-F36TGFK2.js";
6
6
  export {
7
7
  ProcessManager,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MGIXKKM6.js";
4
4
  import {
5
5
  processManager
6
- } from "./chunk-V2PINWUG.js";
6
+ } from "./chunk-P7H2VG3B.js";
7
7
  import {
8
8
  LAUNCH_MODES,
9
9
  configManager,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contextswitch",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Domain-based context management for Claude Code CLI",
5
5
  "main": "dist/cli.js",
6
6
  "type": "module",